From 92763ead0e13e3d99c51a1182064850744d4f522 Mon Sep 17 00:00:00 2001 From: stevenj Date: Fri, 30 Jul 2010 10:35:20 -0400 Subject: [PATCH] NLOPT_DLL_EXPORT option to compile with MS dllexport flag, thanks to Benoit for the suggestion darcs-hash:20100730143520-c8de0-4b368e6403b28260a9221769b452f898b6945f5c.gz --- api/nlopt.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.30.2