added more cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6744 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1f5520131a
commit
26c7c807e9
3 changed files with 70 additions and 0 deletions
|
|
@ -24,3 +24,46 @@ FIELD(b, NEXT_CONST);
|
||||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
// bug #940318
|
||||||
|
%inline %{
|
||||||
|
typedef enum {
|
||||||
|
eZero = 0
|
||||||
|
#define ONE 1
|
||||||
|
} EFoo;
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
// bug #754443
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
#define MAG_STYLE_BORDER_OFFS 0
|
||||||
|
#define MAG_STYLE_BORDER_BITS 3
|
||||||
|
#define MAG_STYLE_BORDER_MASK (((1UL<<MAG_STYLE_BORDER_BITS)-1)<<MAG_STYLE_BORDER_OFFS)
|
||||||
|
|
||||||
|
/* these CANNOT be combined */
|
||||||
|
#define MAG_STYLE_BORDER_NONE (1 << MAG_STYLE_BORDER_OFFS)
|
||||||
|
#define MAG_STYLE_BORDER_STATIC (2 << MAG_STYLE_BORDER_OFFS)
|
||||||
|
#define MAG_STYLE_BORDER_SIMPLE (3 << MAG_STYLE_BORDER_OFFS)
|
||||||
|
#define MAG_STYLE_BORDER_RAISED (4 << MAG_STYLE_BORDER_OFFS)
|
||||||
|
#define MAG_STYLE_BORDER_DOUBLE (5 << MAG_STYLE_BORDER_OFFS)
|
||||||
|
#define MAG_STYLE_BORDER_DEFAULT MAG_STYLE_BORDER_SIMPLE
|
||||||
|
|
||||||
|
|
||||||
|
#define MAG_STYLE_CAPTION_OFFS ( MAG_STYLE_BORDER_OFFS + MAG_STYLE_BORDER_BITS )
|
||||||
|
#define MAG_STYLE_CAPTION_BITS 8
|
||||||
|
#define MAG_STYLE_CAPTION_MASK (((1UL<<MAG_STYLE_CAPTION_BITS)-1)<<MAG_STYLE_CAPTION_OFFS)
|
||||||
|
|
||||||
|
/* these CAN be combined */
|
||||||
|
#define MAG_STYLE_CAPTION_NONE ( 1 << ( 0 + MAG_STYLE_CAPTION_OFFS ))
|
||||||
|
#define MAG_STYLE_CAPTION_PRESENT ( 1 << ( 1 + MAG_STYLE_CAPTION_OFFS ))
|
||||||
|
#define MAG_STYLE_CAPTION_SYSMENU ( 1 << ( 2 + MAG_STYLE_CAPTION_OFFS ))
|
||||||
|
#define MAG_STYLE_CAPTION_MINIMIZE ( 1 << ( 3 + MAG_STYLE_CAPTION_OFFS ))
|
||||||
|
#define MAG_STYLE_CAPTION_MAXIMIZE ( 1 << ( 4 + MAG_STYLE_CAPTION_OFFS ))
|
||||||
|
#define MAG_STYLE_CAPTION_RESIZE ( 1 << ( 5 + MAG_STYLE_CAPTION_OFFS ))
|
||||||
|
#define MAG_STYLE_CAPTION_TINYHOR ( 1 << ( 6 + MAG_STYLE_CAPTION_OFFS ))
|
||||||
|
#define MAG_STYLE_CAPTION_TINYVER ( 1 << ( 7 + MAG_STYLE_CAPTION_OFFS ))
|
||||||
|
#define MAG_STYLE_CAPTION_DEFAULT ( MAG_STYLE_CAPTION_RESIZE + MAG_STYLE_CAPTION_MAXIMIZE + MAG_STYLE_CAPTION_MINIMIZE + MAG_STYLE_CAPTION_SYSMENU + MAG_STYLE_CAPTION_PRESENT )
|
||||||
|
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
// this example shows a problem with 'dump_nested' (parser.y).
|
// this example shows a problem with 'dump_nested' (parser.y).
|
||||||
|
|
||||||
|
// bug #949654
|
||||||
%inline %{
|
%inline %{
|
||||||
typedef struct s1 {
|
typedef struct s1 {
|
||||||
union {
|
union {
|
||||||
|
|
@ -19,3 +20,22 @@ char *name;
|
||||||
} s2;
|
} s2;
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
// bug #491476
|
||||||
|
%inline %{
|
||||||
|
struct {
|
||||||
|
struct {
|
||||||
|
int a;
|
||||||
|
} a, b;
|
||||||
|
} a;
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
||||||
|
// bug #909387
|
||||||
|
%inline %{
|
||||||
|
struct foo {
|
||||||
|
struct happy; // no warning
|
||||||
|
struct sad { int x; }; // warning
|
||||||
|
happy *good(); // produces good code
|
||||||
|
sad *bad(); // produces bad code
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -283,4 +283,11 @@ inline const char* mangle ## #@__VA_ARGS__ () {
|
||||||
const int endif = 1;
|
const int endif = 1;
|
||||||
const int define = 1;
|
const int define = 1;
|
||||||
const int defined = 1;
|
const int defined = 1;
|
||||||
|
int test(int defined)
|
||||||
|
{
|
||||||
|
return defined;
|
||||||
|
}
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue