]> granicus.if.org Git - graphviz/commitdiff
changes required for MS visual studio DLL build
authorarif <devnull@localhost>
Wed, 21 Jan 2009 16:47:00 +0000 (16:47 +0000)
committerarif <devnull@localhost>
Wed, 21 Jan 2009 16:47:00 +0000 (16:47 +0000)
lib/gvc/gvconfig.c
lib/gvc/gvio.h

index a5d378d22af40f0017003c7892e3a5a63c3e6eac..515f702d7780c8a4476902d1232c5344bb8e1005 100644 (file)
@@ -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,
index 5ba32081bb4d69c7d10d3f19f5e7db8da26ba2bd..50694460b1362dfb41dccbdd46a69b0889e30b49 100644 (file)
@@ -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, ...);