Skip to content

Commit

Permalink
fix OSX64 ABI mismatch with divcoeff
Browse files Browse the repository at this point in the history
- also apply fix from #6180 (Issue 16536) to divcoeff.c
- add comment that declarations must be kept in sync
  • Loading branch information
MartinNowak committed Oct 9, 2016
1 parent fa464f3 commit 01a6061
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/backend/cdef.h
Expand Up @@ -477,6 +477,7 @@ typedef unsigned targ_ulong;
*
* As a proper fix we should use uint64_t on both sides, which is always unsigned long long.
*/
// This MUST MATCH typedef ullong in divcoeff.c.
#if defined(__UINT64_TYPE__) && !defined(__APPLE__)
typedef __INT64_TYPE__ targ_llong;
typedef __UINT64_TYPE__ targ_ullong;
Expand Down
3 changes: 2 additions & 1 deletion src/backend/divcoeff.c
Expand Up @@ -13,7 +13,8 @@ Source: https://github.com/dlang/dmd/blob/master/src/backend/divcoeff.c
#include <stdio.h>
#include <assert.h>

#ifdef __UINT64_TYPE__
// This MUST MATCH typedef targ_ullong in cdef.h.
#if defined(__UINT64_TYPE__) && !defined(__APPLE__)
typedef __UINT64_TYPE__ ullong;
#elif defined(__UINTMAX_TYPE__)
typedef __UINTMAX_TYPE__ ullong;
Expand Down

0 comments on commit 01a6061

Please sign in to comment.