This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH libffi win64 support



On Jun 12, 2009, at 4:03 PM, Andrew Haley wrote:



I don't think PRIdMAX would work either; on my linux it's mapped to the
"ld" as well.


Since there's no PRIxxx defined that explicitly maps to long long, we
could put one in ffitest.h and use that.
Something like:

#ifdef WIN64
#define PRIdLL PRId64
#define PRIuLL PRIu64
#else
#define PRIdLL lld
#define PRIuLL llu
#endif

Sounds OK.

Here's the correct snippet:


/* Provide an appropriate "long long" print format. */
#if defined(X86_WIN32) || defined(X86_WIN64)
#define PRIdLL PRId64
#define PRIuLL PRIu64
#else
#define PRIdLL "lld"
#define PRIuLL "llu"
#endif

NOTE: apparently "lld" will work on OSX 10.2 and later; inttypes.h on OSX defines the PRIdMAX as "jd" to work with prior OS versions.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]