Skip to content

Commit

Permalink
Merge pull request #4 from vtjnash/jn/ifdef
Browse files Browse the repository at this point in the history
use #ifdef in public headers instead of just #if
  • Loading branch information
Keno committed Nov 7, 2015
2 parents 17541fc + f0983fc commit d470411
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions include/libunwind.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ typedef struct unw_proc_info_t unw_proc_info_t;
extern "C" {
#endif

#if !__arm__
#ifndef __arm__
extern int unw_getcontext(unw_context_t*) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_5_0);
extern int unw_init_local(unw_cursor_t*, unw_context_t*) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_5_0);
extern int unw_step(unw_cursor_t*) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_5_0);
Expand All @@ -107,7 +107,7 @@ extern int unw_get_proc_name(unw_cursor_t*, char*, size_t, unw_word_t*)
extern int unw_init_local_dwarf(unw_cursor_t*, unw_context_t*);


#if UNW_REMOTE
#ifdef UNW_REMOTE
/*
* Mac OS X "remote" API for unwinding other processes on same machine
*
Expand Down
8 changes: 4 additions & 4 deletions include/mach-o/dyld_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <mach-o/dyld.h>
#include <mach-o/dyld_images.h>

#if __cplusplus
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

Expand Down Expand Up @@ -104,7 +104,7 @@ typedef struct {
size_t tlv_size; // Byte size of TLV storage
} dyld_tlv_info;

#if __BLOCKS__
#ifdef __BLOCKS__

//
// Callback that notes changes to thread-local variable storage.
Expand Down Expand Up @@ -213,7 +213,7 @@ extern uint32_t dyld_get_program_min_os_version();



#if __IPHONE_OS_VERSION_MIN_REQUIRED
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
//
// Returns if any OS dylib has overridden its copy in the shared cache
//
Expand All @@ -223,7 +223,7 @@ extern bool dyld_shared_cache_some_image_overridden();



#if __cplusplus
#ifdef __cplusplus
}
#endif /* __cplusplus */

Expand Down
10 changes: 5 additions & 5 deletions include/unwind.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct _Unwind_Exception {
void (*exception_cleanup)(_Unwind_Reason_Code reason, struct _Unwind_Exception* exc);
uintptr_t private_1; // non-zero means forced unwind
uintptr_t private_2; // holds sp that phase1 found for phase2 to use
#if !__LP64__
#ifndef __LP64__
// The gcc implementation of _Unwind_Exception used attribute mode on the above fields
// which had the side effect of causing this whole struct to round up to 32 bytes in size.
// To be more explicit, we add pad fields added for binary compatibility.
Expand Down Expand Up @@ -101,7 +101,7 @@ extern "C" {
//
// The following are the base functions documented by the C++ ABI
//
#if __arm__
#ifdef __arm__
extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException(struct _Unwind_Exception* exception_object);
extern void _Unwind_SjLj_Resume(struct _Unwind_Exception* exception_object);
#else
Expand All @@ -115,13 +115,13 @@ extern uintptr_t _Unwind_GetIP(struct _Unwind_Context* context);
extern void _Unwind_SetIP(struct _Unwind_Context*, uintptr_t new_value);
extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context* context);
extern uintptr_t _Unwind_GetLanguageSpecificData(struct _Unwind_Context* context);
#if __arm__
#ifdef __arm__
extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind(struct _Unwind_Exception* exception_object, _Unwind_Stop_Fn stop, void* stop_parameter );
#else
extern _Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception* exception_object, _Unwind_Stop_Fn stop, void* stop_parameter );
#endif

#if __arm__
#ifdef __arm__
typedef struct _Unwind_FunctionContext* _Unwind_FunctionContext_t;
extern void _Unwind_SjLj_Register(_Unwind_FunctionContext_t fc);
extern void _Unwind_SjLj_Unregister(_Unwind_FunctionContext_t fc);
Expand All @@ -135,7 +135,7 @@ extern uintptr_t _Unwind_GetLanguageSpecificData(struct _Unwind_Context* context
//
// called by __cxa_rethrow().
//
#if __arm__
#ifdef __arm__
extern _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow(struct _Unwind_Exception* exception_object);
#else
extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception* exception_object);
Expand Down

0 comments on commit d470411

Please sign in to comment.