]> granicus.if.org Git - graphviz/commitdiff
lib/gvpr: use GVDLL instead of _WIN32 to control gprDisc init in compile.c
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 2 Jan 2022 15:02:47 +0000 (16:02 +0100)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 9 Jan 2022 08:44:20 +0000 (09:44 +0100)
Without this change, an upcoming commit that changes cgraph.h to use
GVDLL instead of _WIN32 to control storage-class attributes would
cause this error:

compile.c:85:29: error: initializer element is not constant
   85 | static Agdisc_t gprDisc = { &AgMemDisc, &AgIdDisc, &gprIoDisc };
      |                             ^
compile.c:85:29: note: (near initialization for ‘gprDisc.mem’)

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

lib/gvpr/compile.c

index 0c06bfeb7bcfbaa1b2f3fb40c4228e73561f7541..acdd987f26917c8275fe83e921a5e620b9db9d2c 100644 (file)
@@ -79,7 +79,7 @@ static int ioflush(void *chan)
 
 static Agiodisc_t gprIoDisc = { iofread, ioputstr, ioflush };
 
-#ifdef _WIN32
+#ifdef GVDLL
 static Agdisc_t gprDisc = { 0, 0, &gprIoDisc };
 #else
 static Agdisc_t gprDisc = { &AgMemDisc, &AgIdDisc, &gprIoDisc };