Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / cpp / wxapi.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        cpp/wxapi.h
3 // Purpose:     Magic to be included to get access to wxPerl API
4 // Author:      Mattia Barbon
5 // Modified by:
6 // Created:     21/09/2002
7 // RCS-ID:      $Id: wxapi.h 2714 2009-12-23 23:46:16Z mbarbon $
8 // Copyright:   (c) 2002-2003, 2005-2009 Mattia Barbon
9 // Licence:     This program is free software; you can redistribute it and/or
10 //              modify it under the same terms as Perl itself
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifdef __CPP_WXAPI_H
14 #error cpp/wxapi.h must be included only once!
15 #endif
16
17 #define __CPP_WXAPI_H
18
19 #undef bool
20
21 #if defined( __WXMSW__ )
22 #define STRICT
23 #endif
24
25 #include <wx/defs.h>
26
27 #include "cpp/compat.h"
28
29 #if WXPERL_W_VERSION_LT( 2, 5, 3 ) || WXPERL_W_VERSION_EQ( 2, 7, 0 ) || \
30     WXPERL_W_VERSION_EQ( 2, 7, 1 )
31 #error wxWidgets 2.4.x, 2.5.0, 2.5.1, 2.5.2, 2.7.0, 2.7.1 are no longer supported by wxPerl
32 #endif
33
34 #if WXPERL_W_VERSION_LE( 2, 5, 1 )
35 #define compatibility_iterator Node*
36 #endif
37
38 #include "cpp/chkconfig.h"
39
40 #if defined(__WXWINCE__)
41 #undef __WINDOWS__
42 #endif
43
44 #if defined(__VISUALC__) || defined(__DIGITALMARS__)
45 #define mode_t mode_avoid_redefinition_t
46 #endif
47
48 WXPL_EXTERN_C_START
49 #include <EXTERN.h>
50 #include <perl.h>
51 #include <XSUB.h>
52 WXPL_EXTERN_C_END
53
54 #if WXPERL_P_VERSION_LT( 5, 10, 0 )
55
56 // fix newXS type for perl 5.8
57 inline CV* wxPli_newXS(pTHX_ const char* name, XSUBADDR_t addr,
58                        const char* file)
59 {
60     return newXS( (char*)name, addr, (char*)file );
61 }
62
63 #undef newXS
64 #define newXS( a, b, c ) wxPli_newXS( aTHX_ a, b, c )
65
66 #endif
67
68 #if defined(__VISUALC__) || defined(__DIGITALMARS__)
69 #undef mode_t
70 #endif
71
72 #if WXPERL_P_VERSION_GE( 5, 9, 0 ) || WXPERL_P_VERSION_GE( 5, 8, 1 )
73
74 // XXX this is an hack
75 #undef assert_not_ROK
76 #define assert_not_ROK(sv)
77
78 #endif
79
80 #undef bool
81 #undef Move
82 #undef Copy
83 #undef New
84 #undef Pause
85 #undef Mkdir
86 #undef Seek
87 #undef Stat
88 #undef Error
89 #undef do_open
90 #undef do_close
91 #undef utf8_length
92 #if defined( PERL_IMPLICIT_SYS )
93 #undef abort
94 #undef clearerr
95 #undef close
96 #undef eof
97 #undef exit
98 #undef fclose
99 #undef feof
100 #undef ferror
101 #undef fflush
102 #undef fgetpos
103 #undef fopen
104 #undef form
105 #undef fputc
106 #undef fputs
107 #undef fread
108 #undef free
109 #undef freopen
110 #undef fseek
111 #undef fsetpos
112 #undef ftell
113 #undef fwrite
114 #undef getc
115 #undef getenv
116 #undef malloc
117 #undef open
118 #undef read
119 #undef realloc
120 #undef rename
121 #undef seekdir
122 #undef setbuf
123 #undef setvbuf
124 #undef tmpfile
125 #undef tmpnam
126 #undef ungetc
127 #undef vform
128 #undef vfprintf
129 #undef write
130 #endif
131
132 #if __VISUALC__
133 #pragma warning ( disable: 4800 )
134 #pragma warning ( disable: 4100 ) // unreferenced formal parameter
135 #pragma warning ( disable: 4101 ) // unreferenced local variable
136 #pragma warning ( disable: 4706 ) // assignment within conditional expression
137 #endif
138
139 #ifdef __WXMSW__
140 #include <wx/msw/winundef.h>
141 #endif // __WXMSW__
142
143 // some helper functions/classes/macros
144 #include "cpp/helpers.h"
145
146 // 0.01 -> 0010; 1.01 -> 1010, etc
147 #define WXPL_API_VERSION 0150