]> granicus.if.org Git - graphviz/commitdiff
pathplan: add storage-class attribute declarations in tri.h
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 11 Aug 2021 13:41:26 +0000 (15:41 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 19 Dec 2021 20:20:34 +0000 (21:20 +0100)
This will allow removing the tri.h symbols from the pathplan.def file in an
upcoming commit.

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

lib/pathplan/tri.h

index b69e7a27c70e568a7682639695faf1809f25a1e2..2747237242e9059a17a95d0df866c828859b7baa 100644 (file)
@@ -15,11 +15,25 @@ extern "C" {
 
 #include <pathgeom.h>
 
+#ifdef GVDLL
+#ifdef PATHPLAN_EXPORTS
+#define TRI_API __declspec(dllexport)
+#else
+#define TRI_API __declspec(dllimport)
+#endif
+#endif
+
+#ifndef TRI_API
+#define TRI_API /* nothing */
+#endif
+
 /* Points in polygon must be in CCW order */
-    int Ptriangulate(Ppoly_t * polygon,
+    TRI_API int Ptriangulate(Ppoly_t * polygon,
                      void (*fn) (void *closure, Ppoint_t tri[]),
                      void *vc);
 
+#undef TRI_API
+
 #ifdef __cplusplus
 }
 #endif