From 319cc74a7a344411862ed3e8ffa8b190e49f6f46 Mon Sep 17 00:00:00 2001 From: Erwin Janssen Date: Tue, 3 Jan 2017 19:20:58 +0100 Subject: [PATCH] Made xdot a dynamic library on Windows xdot is a dynamic library with the Autotools build, but was for some reason a static library on Windows. Since Autotools is considered the default, this commit makes xdot a dynamic library on Windows as well. The added define "XDOT_API", is used for linking, so a seperate xdot.def file is not needed. On non-Windows platforms, this define is set to "extern", so nothing changes there. --- lib/gvc.vcxproj | 4 ++-- lib/xdot/xdot.h | 32 +++++++++++++++++++++----------- lib/xdot/xdot.vcxproj | 17 +++++++++++++---- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/lib/gvc.vcxproj b/lib/gvc.vcxproj index 4f6ff891c..2149fd9c7 100644 --- a/lib/gvc.vcxproj +++ b/lib/gvc.vcxproj @@ -63,7 +63,7 @@ 4996 - $(SolutionDir)windows\dependencies\rxspencer\lib;$(SolutionDir)windows\dependencies\GTK2\lib;$(SolutionDir)windows\dependencies\libtool\lib;$(SolutionDir)windows\dependencies\expat\Bin;%(AdditionalLibraryDirectories) + $(SolutionDir)windows\dependencies\rxspencer\lib;$(SolutionDir)windows\dependencies\GTK2\lib;$(SolutionDir)windows\dependencies\libtool\lib;$(SolutionDir)windows\dependencies\expat\Bin;$(OutDir);%(AdditionalLibraryDirectories) true Windows @@ -95,7 +95,7 @@ copy $(SolutionDir)windows\dependencies\GTK2\bin\zlib1.dll $(OutDir)zlib1.dll4996 - $(SolutionDir)windows\dependencies\rxspencer\lib;$(SolutionDir)windows\dependencies\GTK2\lib;$(SolutionDir)windows\dependencies\libtool\lib;$(SolutionDir)windows\dependencies\expat\Bin;%(AdditionalLibraryDirectories) + $(SolutionDir)windows\dependencies\rxspencer\lib;$(SolutionDir)windows\dependencies\GTK2\lib;$(SolutionDir)windows\dependencies\libtool\lib;$(SolutionDir)windows\dependencies\expat\Bin;$(OutDir);%(AdditionalLibraryDirectories) No Windows true diff --git a/lib/xdot/xdot.h b/lib/xdot/xdot.h index be843378a..b373caa95 100755 --- a/lib/xdot/xdot.h +++ b/lib/xdot/xdot.h @@ -21,6 +21,16 @@ extern "C" { #endif +#ifdef _WIN32 +# ifdef EXPORT_XDOT +# define XDOT_API __declspec(dllexport) +# else +# define XDOT_API __declspec(dllimport) +# endif +#else +# define XDOT_API extern +#endif + #define INITIAL_XDOT_CAPACITY 512 typedef enum { @@ -162,17 +172,17 @@ typedef struct { } xdot_stats; /* ops are indexed by xop_kind */ -extern xdot* parseXDotF (char*, drawfunc_t opfns[], int sz); -extern xdot* parseXDotFOn (char*, drawfunc_t opfns[], int sz, xdot*); -extern xdot* parseXDot (char*); -extern char* sprintXDot (xdot*); -extern void fprintXDot (FILE*, xdot*); -extern void jsonXDot (FILE*, xdot*); -extern void freeXDot (xdot*); -extern int statXDot (xdot*, xdot_stats*); -extern xdot_grad_type colorTypeXDot (char*); -extern char* parseXDotColor (char* cp, xdot_color* clr); -extern void freeXDotColor (xdot_color*); +XDOT_API xdot* parseXDotF (char*, drawfunc_t opfns[], int sz); +XDOT_API xdot* parseXDotFOn (char*, drawfunc_t opfns[], int sz, xdot*); +XDOT_API xdot* parseXDot (char*); +XDOT_API char* sprintXDot (xdot*); +XDOT_API void fprintXDot (FILE*, xdot*); +XDOT_API void jsonXDot (FILE*, xdot*); +XDOT_API void freeXDot (xdot*); +XDOT_API int statXDot (xdot*, xdot_stats*); +XDOT_API xdot_grad_type colorTypeXDot (char*); +XDOT_API char* parseXDotColor (char* cp, xdot_color* clr); +XDOT_API void freeXDotColor (xdot_color*); #ifdef __cplusplus } diff --git a/lib/xdot/xdot.vcxproj b/lib/xdot/xdot.vcxproj index 67a649001..bd266b62d 100644 --- a/lib/xdot/xdot.vcxproj +++ b/lib/xdot/xdot.vcxproj @@ -18,11 +18,11 @@ - StaticLibrary + DynamicLibrary v140 - StaticLibrary + DynamicLibrary v140 @@ -52,7 +52,7 @@ Disabled $(ProjectDir);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + WIN32;EXPORT_XDOT;_DEBUG;_LIB;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -63,11 +63,15 @@ 4996 + + Console + + $(ProjectDir);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + WIN32;EXPORT_XDOT;NDEBUG;_LIB;%(PreprocessorDefinitions) MultiThreaded Level4 @@ -75,6 +79,11 @@ 4996 + + false + Console + + -- 2.40.0