ochafik/nativelibs4java — Issue #230: Parsing D3DX10math.h ends in an Out Of Memory error after a long wait
Author: cessationoftime
Created: 2012-01-11 03:36:47+00:00
State: open

Using JNAerator-0.9.8-shaded.jar

config.jnaerator looks like this:
------------------------------
-DWIN32_LEAN_AND_MEAN=
-DNOCOMM=
-DNOSOUND=
-DNOKANJI=
-DNOSYSMETRICS=
-DNOICONS=
-DNOSERVICE=
-DNOSOUND=
-DNOTEXTMETRIC=
-DNOKANJI=
-DNOHELP=
-DNOPROFILER=
-DNOMCX=
-DWINVER=0x0502
-D_WIN32_WINNT=0x0502
-D_WIN32_IE=0x0603
-root com.redsoft.keyhole.windows.api
-scalaStructSetters
-D_MSC_VER=1600
-DMIDL_PASS=1
-DHRESULT=int
-DDWORD=int
-DBYTE=char
-DSIZE_T=size_t
-D__stdcall=
-D__cplusplus=1
-DVOID=void
-DBOOL=int
-DPVOID=void*
"-DMIDL_INTERFACE(x)=struct __declspec(uuid(x)) __declspec(novtable)"
"-IC:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include"
"-IC:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include"
"-IC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
-library d3dx10
"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3d10.h"
"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx10.h"
//running out of memory GC overhead on this header
"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx10math.h"
"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx10core.h"
"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx10tex.h"
"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx10mesh.h"
"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx10async.h"
-noJar -noComp
-o src/main/jnaerated
-v
-runtime BridJ

JNAerator is unable to give any serious output unless one comments out the #include for the math header in d3dx10.h, then it is able to parse the other files and can ignore d3dx10math.h

JNAerator appears to be failing at approx line 90 of d3dx10math.h when it reaches the following struct:

typedef struct D3DXFLOAT16
{
#ifdef __cplusplus
public:
D3DXFLOAT16() {};
D3DXFLOAT16( FLOAT );
D3DXFLOAT16( CONST D3DXFLOAT16& );
// casting
operator FLOAT ();
// binary operators
BOOL operator == ( CONST D3DXFLOAT16& ) const;
BOOL operator != ( CONST D3DXFLOAT16& ) const;
protected:
#endif //__cplusplus
WORD value;
} D3DXFLOAT16, *LPD3DXFLOAT16;

One can get pretty good output from d3dx10math.h by using "#undef __cplusplus" to ignore the faulty sections of the file and then redefining it at the end of d3dx10math.h

see: http://groups.google.com/group/nativelibs4java/browse_thread/thread/2bbe5a69e681ca51