瀏覽代碼

Use the visibility attribute for newer GCC versions

In newer versions of GCC the exporting of symbols can be controlled with
an attribute if -fvisibility=hidden is used. This patch allows the
CIVETWEB_API macro to work with this flag.
Matt Clarkson 10 年之前
父節點
當前提交
a68e70f3c8
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      include/civetweb.h

+ 2 - 0
include/civetweb.h

@@ -34,6 +34,8 @@
 #else
 #else
 #define CIVETWEB_API
 #define CIVETWEB_API
 #endif
 #endif
+#elif __GNUC__ >= 4
+#define CIVETWEB_API __attribute__((visibility ("default")))
 #else
 #else
 #define CIVETWEB_API
 #define CIVETWEB_API
 #endif
 #endif