libreplace: added _PUBLIC_ and _PRIVATE_ to replace.h
authorAndrew Tridgell <tridge@samba.org>
Sun, 18 Apr 2010 02:44:58 +0000 (12:44 +1000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 18 Apr 2010 05:00:37 +0000 (15:00 +1000)
these are needed for all libs that use ABI checking, so libreplace
is the logical place for now

lib/replace/replace.h
lib/util/attr.h

index 7adc224bf2de944ba49850809ea3bdb23e08c1c6..713634e54166cb3cd1bcaa6d4fa7a7843622a01c 100644 (file)
@@ -753,4 +753,22 @@ char *ufc_crypt(const char *key, const char *salt);
 #define fdatasync(fd) fsync(fd)
 #endif
 
+/* these are used to mark symbols as local to a shared lib, or
+ * publicly available via the shared lib API */
+#ifndef _PUBLIC_
+#ifdef HAVE_VISIBILITY_ATTR
+#define _PUBLIC_ __attribute__((visibility("default")))
+#else
+#define _PUBLIC_
+#endif
+#endif
+
+#ifndef _PRIVATE_
+#ifdef HAVE_VISIBILITY_ATTR
+#  define _PRIVATE_ __attribute__((visibility("hidden")))
+#else
+#  define _PRIVATE_
+#endif
+#endif
+
 #endif /* _LIBREPLACE_REPLACE_H */
index f64b272a674e12b44916b5eda69df06238cd5a99..9b346459b60746c61f55b4131db556d26cd99677 100644 (file)
 /** Feel free to add definitions for other compilers here. */
 #endif
 
-#ifdef HAVE_VISIBILITY_ATTR
-#  define _PUBLIC_ __attribute__((visibility("default")))
-#else
-#  define _PUBLIC_
-#endif
-
 #ifndef _DEPRECATED_
 #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
 #define _DEPRECATED_ __attribute__ ((deprecated))