Skip to content

Commit

Permalink
Fix asmconstants for win64 (LLP64)
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Jan 22, 2018
1 parent 038543f commit 54c0c83
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion asmconstants.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
#ifdef __LP64__
#if defined(__SIZEOF_POINTER__) && defined(__SIZEOF_LONG__)
#define LIBOBJC2_POINTER_WIDTH __SIZEOF_POINTER__
#define LIBOBJC2_LONG_WIDTH __SIZEOF_LONG__
#elif defined(__LP64__)
#define LIBOBJC2_POINTER_WIDTH 8
#define LIBOBJC2_LONG_WIDTH 8
#else // defined(__LP64__)
#define LIBOBJC2_POINTER_WIDTH 4
#define LIBOBJC2_LONG_WIDTH 4
#endif // SIZEOF_POINTER/LONG, __LP64__

#if LIBOBJC2_POINTER_WIDTH == 8 && LIBOBJC2_LONG_WIDTH == 8
// 64-bit (non-windows)
#define DTABLE_OFFSET 64
#define SMALLOBJ_BITS 3
#define SHIFT_OFFSET 0
#define DATA_OFFSET 8
#define SLOT_OFFSET 32
#elif LIBOBJC2_POINTER_WIDTH == 8 && LIBOBJC2_LONG_WIDTH == 4
// 64-bit (windows)
#define DTABLE_OFFSET 56
#define SMALLOBJ_BITS 3
#define SHIFT_OFFSET 0
#define DATA_OFFSET 8
#define SLOT_OFFSET 32
#else
// 32-bit (all other targets)
#define DTABLE_OFFSET 32
#define SMALLOBJ_BITS 1
#define SHIFT_OFFSET 0
Expand Down

0 comments on commit 54c0c83

Please sign in to comment.