~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Examples/test-suite/extern_declaration.i

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module extern_declaration 
 
2
 
 
3
// Test different calling conventions on Windows. Old versions of SWIG generated
 
4
// an incorrect extern declaration that wouldn't compile with Windows compilers.
 
5
#define SWIGEXPORT
 
6
#define SWIGSTDCALL
 
7
#define MYDLLIMPORT
 
8
 
 
9
%{
 
10
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
 
11
#  define MYDLLIMPORT __declspec(dllimport)
 
12
#else
 
13
#  define MYDLLIMPORT
 
14
#endif
 
15
%}
 
16
 
 
17
MYDLLIMPORT extern int externimport(int i);
 
18
SWIGEXPORT extern int externexport(int);
 
19
extern int SWIGSTDCALL externstdcall(int);
 
20
 
 
21
%{
 
22
// externimport ought to be using MYDLLIMPORT and compiled into another dll, but that is 
 
23
// a bit tricky to do in the test framework
 
24
SWIGEXPORT extern int externimport(int i) { return i; }
 
25
SWIGEXPORT extern int externexport(int i) { return i; }
 
26
extern int SWIGSTDCALL externstdcall(int i) { return i; }
 
27
%}
 
28
 
 
29