logo       

Wrapping __declspec(dllimport) and __stdcall: msg#00175

programming.swig

Subject: Wrapping __declspec(dllimport) and __stdcall

I have an external Windows DLL that I have to wrap that has declarations as
such:

__declspec(dllimport) void __stdcall foo(char *)

I cannot find a way to properly handle this sitation. Here is what I've tried:


1) If I include my header in my wrapper.i file as follows then I receive syntax
errors from SWIG

%{
#include "sample.h"
%}

%include "sample.h";


2) If I include my header in my wrapper as follows then I receive
"redefinition; different type modifiers" on compile.

%{
#include "sample.h"
%}

extern void foo(char *);


So how can I have external declarations that pass SWIG's syntax check but also
generate the proper C wrapper code. The issue as I see it it that my #2 above
will generate declarations that are already defined in the #include and don't
match the code.

Help.

Thanks,

Gary


_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise