diff options
author | Steve MacLean <Steve.MacLean@Microsoft.com> | 2020-05-20 22:48:41 -0400 |
---|---|---|
committer | Steve MacLean <Steve.MacLean@Microsoft.com> | 2020-05-20 22:48:41 -0400 |
commit | a52e5e7cb7948e536eca6c29bfa0d56f57576575 (patch) | |
tree | 22144db3b50b546a5ea77db7d79c12804af4920f /include/tdep-arm | |
parent | 52c6488da816857de4c782bc5217defdb4c0bea3 (diff) | |
download | libunwind-a52e5e7cb7948e536eca6c29bfa0d56f57576575.tar.gz |
Fix MSVC UNW_REMOTE_ONLY compilation errors
Fix errors observed while compiling libunwind for
UNW_REMOTE_ONLY,
library src,
amd64 & aarch64 with an amd64 MSVC compile, and
arm with an x86 MSVC compiler
Use standard compliant variadic macros
GNUC offer non-compliant variadic macros
Switch to standrds compiant variadic macros
Replace non-standard statement expression
GNUC statement expression is non-ISO C compliant
Where a simple inline function will be equivalent, use that instead
Gexpr.c support compilers w/o statement expressions
For this case a simple inline function would change semantics
Make a close approximation with a separate set of macros for non GNUC
Fix UNW_REMOTE_ONLY placement
Exclude function call not required for remote only builds
Fix __attribute__((packed))
On MSVC use pragma pack()
Add THREAD_LOCAL macro
Avoid bare use of __thread
Add MSVC fetch_and_add() support
Use macro ALIGNED(x) in place of __attribute__((aligned(x))
Rename local ltoa to avoid name collision
The Windows x86 SDK headers define ltoa.
Rename this local function to avoid a name collision.
ISO C doesn't allow empty structures
Add padding to allow empty arm/aarch64 structures to compile on MSVC
Diffstat (limited to 'include/tdep-arm')
-rw-r--r-- | include/tdep-arm/libunwind_i.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/tdep-arm/libunwind_i.h b/include/tdep-arm/libunwind_i.h index 2602f41c..19ae4c30 100644 --- a/include/tdep-arm/libunwind_i.h +++ b/include/tdep-arm/libunwind_i.h @@ -151,8 +151,14 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) # define DWARF_LOC_TYPE_FP (1 << 0) # define DWARF_LOC_TYPE_REG (1 << 1) # define DWARF_NULL_LOC DWARF_LOC (0, 0) -# define DWARF_IS_NULL_LOC(l) \ - ({ dwarf_loc_t _l = (l); _l.val == 0 && _l.type == 0; }) + +static inline int +dwarf_is_null_loc(dwarf_loc_t l) +{ + return l.val == 0 && l.type == 0; +} + +# define DWARF_IS_NULL_LOC(l) dwarf_is_null_loc(l) # define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r), .type = (t) }) # define DWARF_IS_REG_LOC(l) (((l).type & DWARF_LOC_TYPE_REG) != 0) # define DWARF_IS_FP_LOC(l) (((l).type & DWARF_LOC_TYPE_FP) != 0) |