[libcxxabi] r192868 - unwinder: conditionalise availability

Saleem Abdulrasool compnerd at compnerd.org
Wed Oct 16 20:57:42 PDT 2013


Author: compnerd
Date: Wed Oct 16 22:57:41 2013
New Revision: 192868

URL: http://llvm.org/viewvc/llvm-project?rev=192868&view=rev
Log:
unwinder: conditionalise availability

__attribute__ (( unavailable )) is for Apple specific builds.  Create a macro
to conditionalise the usage of the macro.  This is to aid in porting the
unwinder to other platforms.

Modified:
    libcxxabi/trunk/include/unwind.h

Modified: libcxxabi/trunk/include/unwind.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/unwind.h?rev=192868&r1=192867&r2=192868&view=diff
==============================================================================
--- libcxxabi/trunk/include/unwind.h (original)
+++ libcxxabi/trunk/include/unwind.h Wed Oct 16 22:57:41 2013
@@ -17,6 +17,12 @@
 #include <stdint.h>
 #include <stddef.h>
 
+#if defined(__APPLE__)
+#define LIBUNWIND_AVAIL __attribute__ (( unavailable ))
+#else
+#define LIBUNWIND_AVAIL
+#endif
+
 typedef enum {
   _URC_NO_REASON = 0,
   _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
@@ -181,28 +187,28 @@ extern void *_Unwind_FindEnclosingFuncti
 // Mac OS X does not support text-rel and data-rel addressing so these functions
 // are unimplemented
 extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context)
-    __attribute__((unavailable));
+    LIBUNWIND_AVAIL;
 extern uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context)
-    __attribute__((unavailable));
+    LIBUNWIND_AVAIL;
 
 // Mac OS X 10.4 and 10.5 had implementations of these functions in
 // libgcc_s.dylib, but they never worked.  
 /// These functions are no longer available on Mac OS X.
 extern void __register_frame_info_bases(const void *fde, void *ob, void *tb,
-                                        void *db) __attribute__((unavailable));
+                                        void *db) LIBUNWIND_AVAIL;
 extern void __register_frame_info(const void *fde, void *ob)
-    __attribute__((unavailable));
+    LIBUNWIND_AVAIL;
 extern void __register_frame_info_table_bases(const void *fde, void *ob,
                                               void *tb, void *db)
-    __attribute__((unavailable));
+    LIBUNWIND_AVAIL;
 extern void __register_frame_info_table(const void *fde, void *ob)
-    __attribute__((unavailable));
+    LIBUNWIND_AVAIL;
 extern void __register_frame_table(const void *fde)
-    __attribute__((unavailable));
+    LIBUNWIND_AVAIL;
 extern void *__deregister_frame_info(const void *fde)
-    __attribute__((unavailable));
+    LIBUNWIND_AVAIL;
 extern void *__deregister_frame_info_bases(const void *fde)
-    __attribute__((unavailable));
+    LIBUNWIND_AVAIL;
 
 #ifdef __cplusplus
 }





More information about the cfe-commits mailing list