- rewrite DLL macros, now somewhat closer to how LT_SCOPE is written

in <ltdl.h>.  Now go back to Linux and test.
This commit is contained in:
Bryce Denney 2002-10-11 15:59:21 +00:00
parent 7f9c1489df
commit 2f74efdb0a
4 changed files with 17 additions and 14 deletions

View File

@ -1,5 +1,5 @@
CXX=g++
CXXFLAGS=-Wall -g
CXXFLAGS=-Wall -g -mno-cygwin
LIBTOOL=libtool
RPATH=`pwd`/lib
@ -13,7 +13,7 @@ libmodule1.la: module1.lo
mkdir -p lib bin
$(LIBTOOL) cp libmodule1.la ${RPATH}
%.lo: %.cc
%.lo: %.cc %.h
$(LIBTOOL) $(CXX) -c $<
clean:

View File

@ -1,10 +1,4 @@
// set up MODULE1API macro for DLL export
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
# define MODULE1API(type) __declspec(dllexport) type __cdecl
#else
# define MODULE1API(type) type
#endif
#define MODULE1_DLL_EXPORT
#include "module1.h"
const char *module_name = "AddModule";

View File

@ -1,10 +1,18 @@
#ifndef MODULE1API
# if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
# define MODULE1API(type) __declspec(dllimport) type __cdecl
# else
# define MODULE1API(type) type
#if defined(WIN32) || defined(__CYGWIN__)
# if defined(MODULE1_DLL_EXPORT) && defined(DLL_EXPORT)
# warning case 1
# define MODULE1API(type) __declspec(dllexport) type
# endif
# ifdef MODULE1_DLL_IMPORT
# warning case 2
# define MODULE1API(type) __declspec(dllimport) type
# endif
#endif
#ifndef MODULE1API
# warning case 3
# define MODULE1API(type) type
#endif
MODULE1API(extern const char *) module_name;
MODULE1API(extern int) operate (int a, int b);

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#define MODULE1_DLL_IMPORT
#include "module1.h"
int main ()