Remove #include compiler.h in public header
@@ -34,7 +34,6 @@ extern "C" {
#include <inttypes.h>
#include <stddef.h>
#include <ucontext.h>
-#include "compiler.h"
#ifndef UNW_EMPTY_STRUCT
# define UNW_EMPTY_STRUCT
@@ -183,6 +182,13 @@ unw_tdep_save_loc_t;
* however, the __reserved struct is quite large: tune it down to only
* the necessary used fields. */
+#ifdef _MSC_VER
+// __attribute__((__aligned__(16))) is a GNUC attribute not recognized by MSVC
+// Since the field alignment doesn't matter for UNW_REMOTE_ONLY,
+// Temproarily define __attribute__(x) to remove it
+#define __attribute__(x)
+#endif
+
struct unw_sigcontext
{
uint64_t fault_address;
@@ -190,9 +196,13 @@ struct unw_sigcontext
uint64_t sp;
uint64_t pc;
uint64_t pstate;
- uint8_t __reserved[(66 * 8)] ALIGNED(16);
+ uint8_t __reserved[(66 * 8)] __attribute__((__aligned__(16)));
};
+#ifdef _MSC_VER
+#undef __attribute__
+#endif
+
typedef struct
{
unsigned long uc_flags;
