build: check immediate structures
authorAndrew Tridgell <tridge@samba.org>
Sun, 7 Mar 2010 06:20:22 +0000 (17:20 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:44 +0000 (20:26 +1000)
lib/replace/wscript

index e999c02eef590133551323c8d1e3a677c94c994b..d10a70342e357c3afa5a5d9ed49fe4708bb85375 100644 (file)
@@ -193,6 +193,20 @@ def configure(conf):
                            execute=True):
             break
 
+    conf.CHECK_CODE('''
+                   typedef struct {unsigned x;} FOOBAR;
+                    #define X_FOOBAR(x) ((FOOBAR) { x })
+                    #define FOO_ONE X_FOOBAR(1)
+                    FOOBAR f = FOO_ONE;
+                    static const struct {
+                        FOOBAR y;
+                    } f2[] = {
+                        {FOO_ONE}
+                    };
+                    static const FOOBAR f3[] = {FOO_ONE};
+                    ''',
+                    define='HAVE_IMMEDIATE_STRUCTURES')
+
 
 
 def build(bld):