Antti Karanta
2005-09-05 11:58:23 UTC
Hi!
I stumbled into a problem w/ a header file containing func definitions
like this:
#define XPORT __declspec(dllimport)
XPORT void func1(const MYChar *szOpt, MYInt *pnIerr);
Swig gives an error message:
C:\Temp\swigtest>swig -java foo.i
foo.h(13): Error: Syntax error in input.
But generates the wrapper files anyway. However, it leaves out some
functions declared for wrapping in the interface file.
I did a (hopefully) minimal example producing the problem, see below.
In the swig interface file I try to wrap two functions, but only the
first one ends up being wrapped.
Am I doing something wrong or is this a swig bug? Any workarounds?
I'm using swig 1.3.25 on WinXP sp2.
-Antti-
Ps. The same problem occurs w/ __declspec(dllexport), which is to be
expected.
Pps. I tried to attach these example files to my previous mail, but
that mail never showed up on the list so I assume posts w/ attachments
are filtered away. Anyway, here are the two files "inlined":
foo.i:
-->
%module FooBar
// the import is done to introduce the typedefs to swig
%import "foo.h"
void func1(const MYChar *szOpt, MYInt *pnIerr);
void func2(const MYChar *szOpt, MYInt *pnIerr);
<--
foo.h:
-->
#define XPORT __declspec(dllimport)
#ifdef __cplusplus
extern "C"
{
#endif
typedef long MYInt;
typedef double MYDouble;
typedef char MYChar;
XPORT void func1(const MYChar *szOpt, MYInt *pnIerr);
XPORT void func2(const MYChar *szOpt, MYInt *pnIerr);
XPORT void func3(const MYChar *szOpt, MYInt *pnIerr);
#ifdef __cplusplus
}
#endif
<--
_______________________________________________
Swig maillist - ***@cs.uchicago.edu
http://mailman.cs.uchicago.edu/mailman/listinfo/swig
I stumbled into a problem w/ a header file containing func definitions
like this:
#define XPORT __declspec(dllimport)
XPORT void func1(const MYChar *szOpt, MYInt *pnIerr);
Swig gives an error message:
C:\Temp\swigtest>swig -java foo.i
foo.h(13): Error: Syntax error in input.
But generates the wrapper files anyway. However, it leaves out some
functions declared for wrapping in the interface file.
I did a (hopefully) minimal example producing the problem, see below.
In the swig interface file I try to wrap two functions, but only the
first one ends up being wrapped.
Am I doing something wrong or is this a swig bug? Any workarounds?
I'm using swig 1.3.25 on WinXP sp2.
-Antti-
Ps. The same problem occurs w/ __declspec(dllexport), which is to be
expected.
Pps. I tried to attach these example files to my previous mail, but
that mail never showed up on the list so I assume posts w/ attachments
are filtered away. Anyway, here are the two files "inlined":
foo.i:
-->
%module FooBar
// the import is done to introduce the typedefs to swig
%import "foo.h"
void func1(const MYChar *szOpt, MYInt *pnIerr);
void func2(const MYChar *szOpt, MYInt *pnIerr);
<--
foo.h:
-->
#define XPORT __declspec(dllimport)
#ifdef __cplusplus
extern "C"
{
#endif
typedef long MYInt;
typedef double MYDouble;
typedef char MYChar;
XPORT void func1(const MYChar *szOpt, MYInt *pnIerr);
XPORT void func2(const MYChar *szOpt, MYInt *pnIerr);
XPORT void func3(const MYChar *szOpt, MYInt *pnIerr);
#ifdef __cplusplus
}
#endif
<--
_______________________________________________
Swig maillist - ***@cs.uchicago.edu
http://mailman.cs.uchicago.edu/mailman/listinfo/swig