]> granicus.if.org Git - graphviz/commitdiff
LASi plugin: work around LASi exporting Freetype’s config.h
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 5 Apr 2022 01:48:58 +0000 (18:48 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 10 Apr 2022 23:39:49 +0000 (16:39 -0700)
plugin/lasi/gvrender_lasi.cpp

index 0534ab7c62c93a04923314d9811ec21e6255d73a..319f9544e3c0be954d034b62451e4136672b8c11 100644 (file)
@@ -8,13 +8,22 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#include "config.h"
-
 #include <iostream>
 #include <fstream>
 #include <stdexcept>
 #include <LASi.h>
 
+// Confusingly, Freetype (included transitively by LASi), ship their Autotools
+// config.h. As a result, we get macros like `HAVE_FCNTL_H` injected from their
+// headers, overriding ours. Suppress this and force ours into scope.
+#ifdef HAVE_FCNTL_H
+#undef HAVE_FCNTL_H
+#endif
+#ifdef HAVE_UNISTD_H
+#undef HAVE_UNISTD_H
+#endif
+#include "config.h"
+
 #include <gvc/gvplugin_render.h>
 #include <gvc/gvplugin_device.h>
 #include <gvc/gvio.h>