[libcxxabi] r288692 - [libc++abi] Add _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 5 11:42:12 PST 2016


Author: smeenai
Date: Mon Dec  5 13:42:11 2016
New Revision: 288692

URL: http://llvm.org/viewvc/llvm-project?rev=288692&view=rev
Log:
[libc++abi] Add _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS

It's useful to be able to disable visibility annotations entirely; for
example, if we're building libc++abi static to include in another library,
and we don't want any libc++abi functions getting exported out of that
library. This is a generalization of _LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT.

Differential Revision: https://reviews.llvm.org/D26950

Modified:
    libcxxabi/trunk/include/__cxxabi_config.h

Modified: libcxxabi/trunk/include/__cxxabi_config.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/__cxxabi_config.h?rev=288692&r1=288691&r2=288692&view=diff
==============================================================================
--- libcxxabi/trunk/include/__cxxabi_config.h (original)
+++ libcxxabi/trunk/include/__cxxabi_config.h Mon Dec  5 13:42:11 2016
@@ -22,7 +22,7 @@
 #endif
 
 #if defined(_WIN32)
- #if defined(_LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT)
+ #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
   #define _LIBCXXABI_HIDDEN
   #define _LIBCXXABI_DATA_VIS
   #define _LIBCXXABI_FUNC_VIS
@@ -39,13 +39,20 @@
   #define _LIBCXXABI_TYPE_VIS __declspec(dllimport)
  #endif
 #else
- #define _LIBCXXABI_HIDDEN __attribute__((__visibility__("hidden")))
- #define _LIBCXXABI_DATA_VIS __attribute__((__visibility__("default")))
- #define _LIBCXXABI_FUNC_VIS __attribute__((__visibility__("default")))
- #if __has_attribute(__type_visibility__)
-  #define _LIBCXXABI_TYPE_VIS __attribute__((__type_visibility__("default")))
+ #if !defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
+  #define _LIBCXXABI_HIDDEN __attribute__((__visibility__("hidden")))
+  #define _LIBCXXABI_DATA_VIS __attribute__((__visibility__("default")))
+  #define _LIBCXXABI_FUNC_VIS __attribute__((__visibility__("default")))
+  #if __has_attribute(__type_visibility__)
+   #define _LIBCXXABI_TYPE_VIS __attribute__((__type_visibility__("default")))
+  #else
+   #define _LIBCXXABI_TYPE_VIS __attribute__((__visibility__("default")))
+  #endif
  #else
-  #define _LIBCXXABI_TYPE_VIS __attribute__((__visibility__("default")))
+  #define _LIBCXXABI_HIDDEN
+  #define _LIBCXXABI_DATA_VIS
+  #define _LIBCXXABI_FUNC_VIS
+  #define _LIBCXXABI_TYPE_VIS
  #endif
 #endif
 




More information about the cfe-commits mailing list