From deace87b4ec0c788ad2ba3dbda6ddf0238254389 Mon Sep 17 00:00:00 2001 From: arif Date: Wed, 21 Jan 2009 16:47:00 +0000 Subject: [PATCH] changes required for MS visual studio DLL build --- lib/gvc/gvconfig.c | 24 +++++++++++++++++++++++- lib/gvc/gvio.h | 10 +++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/gvc/gvconfig.c b/lib/gvc/gvconfig.c index a5d378d22..515f702d7 100644 --- a/lib/gvc/gvconfig.c +++ b/lib/gvc/gvconfig.c @@ -59,11 +59,25 @@ static int glob (GVC_t * gvc, char*, int, int (*errfunc)(const char *, int), glo #include "gvcjob.h" #include "gvcint.h" #include "gvcproc.h" + +/*visual studio*/ +#ifdef WIN32_DLL +#ifndef GVC_EXPORTS +__declspec(dllimport) int Demand_Loading; +#else +__declspec(dllexport) int Demand_Loading; +#endif +#endif +/*end visual studio*/ + +#ifndef WIN32_DLL #ifdef GVDLL __declspec(dllexport) int Demand_Loading; #else extern const int Demand_Loading; #endif +#endif + #ifdef WITH_CODEGENS extern codegen_t HPGL_CodeGen, MIF_CodeGen, MP_CodeGen, PIC_CodeGen, DIA_CodeGen, VTX_CodeGen; @@ -243,10 +257,18 @@ static void gvconfig_plugin_install_builtins(GVC_t * gvc) /* For Windows DLLs using builtins, we need to initialize * the lt_preloaded_symbols table. */ +/*visual studio*/ +#if defined(WIN32_DLL) && !defined(ENABLE_LTDL) + init_lt_preloaded_symbols(); +#endif +/*end visual studio*/ + +#ifndef WIN32_DLL #if defined(GVDLL) && !defined(ENABLE_LTDL) init_lt_preloaded_symbols(); #endif - s = lt_preloaded_symbols; +#endif + s = lt_preloaded_symbols; for (s = lt_preloaded_symbols; (name = s->name); s++) if (name[0] == 'g' && strstr(name, "_LTX_library")) gvconfig_plugin_install_from_library(gvc, NULL, diff --git a/lib/gvc/gvio.h b/lib/gvc/gvio.h index 5ba32081b..50694460b 100644 --- a/lib/gvc/gvio.h +++ b/lib/gvc/gvio.h @@ -29,7 +29,15 @@ extern "C" { #define extern #endif - extern size_t gvwrite (GVJ_t * job, const char *s, size_t len); +/*visual studio*/ +#ifdef WIN32_DLL +#ifndef GVC_EXPORTS +#define extern __declspec(dllimport) +#endif +#endif +/*end visual studio*/ + + extern size_t gvwrite (GVJ_t * job, const char *s, size_t len); extern int gvputc(GVJ_t * job, int c); extern int gvputs(GVJ_t * job, const char *s); extern void gvprintf(GVJ_t * job, const char *format, ...); -- 2.40.0