diff --git a/src/dispatch_common.h b/src/dispatch_common.h index 676a4d5..52743a6 100644 --- a/src/dispatch_common.h +++ b/src/dispatch_common.h @@ -68,8 +68,13 @@ #if defined(__GNUC__) #define PACKED __attribute__((__packed__)) +#define ENDPACKED +#elif defined (_MSC_VER) +#define PACKED __pragma(pack(push,1)) +#define ENDPACKED __pragma(pack(pop)) #else #define PACKED +#define ENDPACKED #endif /* On win32, we're going to need to keep a per-thread dispatch table, diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py index d40f851..dfce596 100755 --- a/src/gen_dispatch.py +++ b/src/gen_dispatch.py @@ -628,6 +628,7 @@ class Generator(object): # Writes the enum declaration for the list of providers # supported by gl_provider_resolver() + self.outln('') self.outln('enum {0}_provider {{'.format(self.target)) sorted_providers = sorted(self.provider_enum.keys()) @@ -640,6 +641,7 @@ class Generator(object): enum = self.provider_enum[human_name] self.outln(' {0},'.format(enum)) self.outln('} PACKED;') + self.outln('ENDPACKED') self.outln('') def write_provider_enum_strings(self):