I am tracking down a problem in the scripting interface and I think I
have found the problem, but I am unsure how to solve it.

Short version: The BUILD_DIR/include directory needs to be added to
the include directories when swig is run.  I don't know what I have to
do to the Jamfiles to do that so I need someone's help.

Long version
****************
Symptom: Building fails with the following errors:

C++ ./out/msysx86/optimize/plugins/cscript/cspython/cs_pyth.o
cs_pyth.cpp: In function `PyObject*
_wrap_csMouseEventHelper_NewEvent__SWIG_2(PyObject*, PyObject*)':
cs_pyth.cpp:2439: error: invalid conversion from `const int*' to `const int32*'
cs_pyth.cpp:2439: error:   initializing argument 6 of `static csEvent*
csMouseEventHelper::NewEvent(csRef<iEventNameRegistry>&, csTicks,
csEventID, uint8, csMouseEventType, const int32*, uint8, uint32, uint,
bool, uint32, uint32)'
cs_pyth.cpp: In function `PyObject*
_wrap_csJoystickEventHelper_NewEvent__SWIG_1(PyObject*, PyObject*)':
cs_pyth.cpp:3188: error: invalid conversion from `const int*' to `const int32*'
cs_pyth.cpp:3188: error:   initializing argument 5 of `static csEvent*
csJoystickEventHelper::NewEvent(csRef<iEventNameRegistry>&, csTicks,
csEventID, int, const int32*, uint8, uint32, uint, bool, uint32,
uint32)'

Cause:
- cspace.i has a line that says: %include "cstypes.h"

- cstypes.h does an #ifdef on CS_HAVE_STDINT_H and CS_HAVE_INTTYPES_H
to determine whether to typedef uint32 to uint32_t or unsigned int.

- cstypes.h includes csplatform.h which includes csconfig.h which is
where CS_HAVE_STDINT_H and CS_HAVE_INTTYPES_H should are defined.

- csconfig.h is located in BUILD_DIR/include not SRC_DIR/include

- BUILD_DIR/include is not added to the include directories when swig
is run on cspace.i

- so swig silently ignores csconfig.h because it can't find it, which
means CS_HAVE_* are never defined, which means uint32 gets typedef'ed
to unsigned int and swig writes its code based on that

- when cs_pyth.cpp is compiled BUILD_DIR/include *is* added as an
include directory so uint32 gets typedef'ed to uint32_t thus making
the compiler complain about casting an int pointer to a uint32
pointer.  (Since they are pointers that cast is not safe even if
casing the non-pointer types would be safe.)

Likely solution: Add BUILD_DIR/include to the include directories when
running swig.  However, I have no idea what to do to the Jamfiles to
achieve that.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to