Remove NET_2_0
[mono.git] / eglib / test / sizes.c
index 771848ce3a6704ecfe394adf5efdaf6d4cca3bae..585cc113779009048e775123a80643319e6c3cd0 100644 (file)
@@ -4,7 +4,9 @@
  * These depend on -Werror, -Wall being set to catch the build error.
  */
 #include <stdio.h>
+#ifndef _MSC_VER
 #include <stdint.h>
+#endif
 #include <string.h>
 #include <glib.h>
 #include "test.h"
@@ -79,9 +81,27 @@ test_ptrconv ()
        
 }
 
+typedef struct {
+       int a;
+       int b;
+} my_struct;
+
+RESULT
+test_offset ()
+{
+       if (G_STRUCT_OFFSET (my_struct, a) != 0)
+               return FAILED ("offset of a is not zero");
+       
+       if (G_STRUCT_OFFSET (my_struct, b) != 4 && G_STRUCT_OFFSET (my_struct, b) != 8)
+               return FAILED ("offset of b is 4 or 8, macro might be busted");
+
+       return OK;
+}
+
 static Test size_tests [] = {
        {"formats", test_formats},
        {"ptrconv", test_ptrconv},
+       {"g_struct_offset", test_offset},
        {NULL, NULL}
 };