🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #1340

Re: [Q] Mac equivalent of __declspec (dllimport)

#1340
From: Tim Hosking
Date: Wed, 08 Nov 2000 00:00
59 lines
2881 bytes
in article pteeson-8AD390.12082008112000@news1.on.sympatico.ca, Peter Teeson
at pteeson@sympatico.ca wrote on 11/8/00 12:06 PM:

> Using Mac CW Pro 6 I'm porting some C++ from Windows and have run into
> something I don't understand. There are several pieces of code of the
> form:
> 
> template class _declspec (dllimport) Foo<sometype>;
> 
> for example
> 
> template class _declspec (dllimport) vector<float>;
> 
> Clearly this is a specialisation for float vectors.
> However on the Mac this gives a compilation error
> 
> Error   : illegal use of incomplete struct/union/class ....
> 
> Removing the _declspec (dllimport) gets a clean compile.
> I've looked up the __declspec(arg) and understand how it's used.
> 
> So what is the Mac equivalent of the dllimport argument?
> 
> TIA for your help
> 
> 
> Peter

#include <conditionalmacros.h>

In there you  will find the following: (sorry about the line-wrapping)

    #define EXTERN_API(_type)                        __declspec(dllimport)
_type __cdecl
    #define EXTERN_API_C(_type)                        __declspec(dllimport)
_type __cdecl
    #define EXTERN_API_STDCALL(_type)                __declspec(dllimport)
_type __stdcall
    #define EXTERN_API_C_STDCALL(_type)                __declspec(dllimport)
_type __stdcall
    #define CALLBACK_API(_type, _name)                _type (__cdecl *
_name)
    #define CALLBACK_API_C(_type, _name)            _type (__cdecl * _name)
    #define CALLBACK_API_STDCALL(_type, _name)        _type (__stdcall *
_name)
    #define CALLBACK_API_C_STDCALL(_type, _name)    _type (__stdcall *
_name)

when building for Windows.

These macros simply use 'extern' when building for the Mac platform. Check
in the Universal Interfaces for examples of their use.

ConditionalMacros.h should work just fine when building on a Windows
platform.

--
Tim Hosking
Before they invented drawing boards, what did they go back to?
Technical Details
Message-ID: <B62EFDBF.6418%tim@trhosking.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <pteeson-8AD390.12082008112000@news1.on.sympatico.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,a1b3993d7bfe04a6
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,a1b3993d7bfe04a6
X-Google-Attributes: gidf635e,public
From: Tim Hosking <tim@trhosking.com>
Subject: Re: [Q] Mac equivalent of __declspec (dllimport)
Date: 2000/11/08
Message-ID: <B62EFDBF.6418%tim@trhosking.com>
X-Deja-AN: 691286840
Content-transfer-encoding: 7bit
References: <pteeson-8AD390.12082008112000@news1.on.sympatico.ca>
Content-Type: text/plain; charset="US-ASCII"
X-Complaints-To: abuse@home.net
X-Trace: news3.rdc1.on.home.com 973706647 24.43.210.13 (Wed, 08 Nov 2000 10:04:07 PST)
Organization: Excite@Home - The Leader in Broadband
Mime-version: 1.0
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022
NNTP-Posting-Date: Wed, 08 Nov 2000 10:04:07 PST
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac