From ce3edba04a52cacae6e1fbc63660994991fdaebd Mon Sep 17 00:00:00 2001 From: erg Date: Tue, 8 May 2007 18:25:54 +0000 Subject: [PATCH] First pass at arranging for DLLs on Windows: need to provide import definition for users of extern data --- lib/agraph/aghdr.h | 1 + lib/agraph/agraph.h | 3 +++ lib/cdt/cdt.h | 3 +++ lib/sfio/sfio.h | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/lib/agraph/aghdr.h b/lib/agraph/aghdr.h index 7ccd3bdc9..11b90a38b 100644 --- a/lib/agraph/aghdr.h +++ b/lib/agraph/aghdr.h @@ -21,6 +21,7 @@ extern "C" { #ifndef ATT_GRAPHPVT_H #define ATT_GRAPHPVT_H 1 +#define _BLD_agraph 1 #ifndef EXTERN #define EXTERN extern diff --git a/lib/agraph/agraph.h b/lib/agraph/agraph.h index 31262b8dc..de4802052 100644 --- a/lib/agraph/agraph.h +++ b/lib/agraph/agraph.h @@ -397,6 +397,9 @@ for the name. */ # if !defined(_BLD_agraph) && defined(__IMPORT__) # define extern __IMPORT__ # endif +#endif +#if !defined(_BLD_agraph) && defined(_WIN32) +#define extern __declspec(dllimport) #endif extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, diff --git a/lib/cdt/cdt.h b/lib/cdt/cdt.h index 1daf92ab1..02804f7ba 100644 --- a/lib/cdt/cdt.h +++ b/lib/cdt/cdt.h @@ -166,6 +166,9 @@ extern "C" { #if _BLD_cdt && defined(__EXPORT__) #define extern __EXPORT__ #endif +#if !_BLD_cdt && defined(_WIN32) +#define extern __declspec(dllimport) +#endif #if !_BLD_cdt && defined(__IMPORT__) #define extern __IMPORT__ #endif diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h index 98445fd26..76784399a 100644 --- a/lib/sfio/sfio.h +++ b/lib/sfio/sfio.h @@ -277,6 +277,9 @@ extern "C" { _BEGIN_EXTERNS_ extern ssize_t _Sfi; +#if !_BLD_sfio && defined(_WIN32) +#define extern __declspec(dllimport) +#endif /* standard in/out/err streams */ extern Sfio_t *sfstdin; extern Sfio_t *sfstdout; @@ -284,6 +287,7 @@ extern "C" { extern Sfio_t _Sfstdin; extern Sfio_t _Sfstdout; extern Sfio_t _Sfstderr; +#undef extern #if _DLL && _DLL_INDIRECT_DATA /* The Uwin shared library environment requires these to be defined -- 2.40.0