From: stevenj Date: Fri, 30 Jul 2010 14:35:20 +0000 (-0400) Subject: NLOPT_DLL_EXPORT option to compile with MS dllexport flag, thanks to Benoit for the... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=92763ead0e13e3d99c51a1182064850744d4f522;p=nlopt.git NLOPT_DLL_EXPORT option to compile with MS dllexport flag, thanks to Benoit for the suggestion darcs-hash:20100730143520-c8de0-4b368e6403b28260a9221769b452f898b6945f5c.gz --- diff --git a/api/nlopt.h b/api/nlopt.h index 0d37c1c..9f19b5b 100644 --- a/api/nlopt.h +++ b/api/nlopt.h @@ -45,7 +45,11 @@ Windows importing nonsense. */ #if defined(NLOPT_DLL) && (defined(_WIN32) || defined(__WIN32__)) && !defined(__LCC__) /* annoying Windows syntax for calling functions in a DLL */ -# define NLOPT_EXTERN(T) extern __declspec(dllimport) T NLOPT_STDCALL +# if defined(NLOPT_DLL_EXPORT) +# define NLOPT_EXTERN(T) extern __declspec(dllexport) T NLOPT_STDCALL +# else +# define NLOPT_EXTERN(T) extern __declspec(dllimport) T NLOPT_STDCALL +# endif #else # define NLOPT_EXTERN(T) extern T NLOPT_STDCALL #endif