Saturday, September 13, 2008

Continuing with Cocoa SWT

I had some problems building the JNI code for Cocoa SWT on my MBP.  First, I didn't want to get sidetracked by building a specific XulRunner SDK, so I just downloaded the 1.9.0.1 binary available from mozilla.org.  Next, I had to make a couple minor modifications to org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak.  After specifying the proper location for XULRUNNER_SDK, I still ran into the following problem in the build:

[exec] /Library/Frameworks/XUL.framework/Versions/1.9.0.1-sdk/sdk/include/nsStringAPI.h:1053: error: size of array 'arg' is negative
That line contains:

  PR_STATIC_ASSERT(sizeof(wchar_t) == 2);
A quick C program proved that wchar_t was actually 4 bytes on my machine.  After commenting out  the HAVE_CPP_2BYTE_WCHAR_T define in mozilla-config.h within my xulrunner install, I reran the build from Eclipse, and everything compiled.  Now on to the actual work of adding NSFormatter and NSNumberFormatter to the JNI code.

No comments: