Support Win64 pointer-sized types

Since we're generating stub types from khrplatform.h because we can't
include it reliably, we'll have to deal with some of the fallout of the
Win64 types.

Fixes: #246
macos/v1.5.9
Emmanuele Bassi 4 years ago
parent 34ecb908b0
commit 144cbc9325
  1. 14
      src/gen_dispatch.py

@ -515,9 +515,17 @@ class Generator(object):
self.outln('typedef uint32_t khronos_uint32_t;') self.outln('typedef uint32_t khronos_uint32_t;')
self.outln('typedef uint64_t khronos_uint64_t;') self.outln('typedef uint64_t khronos_uint64_t;')
self.outln('typedef float khronos_float_t;') self.outln('typedef float khronos_float_t;')
self.outln('typedef long khronos_intptr_t;') self.outln('#ifdef _WIN64')
self.outln('typedef long khronos_ssize_t;') self.outln('typedef signed long long int khronos_intptr_t;')
self.outln('typedef unsigned long khronos_usize_t;') self.outln('typedef unsigned long long int khronos_uintptr_t;')
self.outln('typedef signed long long int khronos_ssize_t;')
self.outln('typedef unsigned long long int khronos_usize_t;')
self.outln('#else')
self.outln('typedef signed long int khronos_intptr_t;')
self.outln('typedef unsigned long int khronos_uintptr_t;')
self.outln('typedef signed long int khronos_ssize_t;')
self.outln('typedef unsigned long int khronos_usize_t;')
self.outln('#endif')
self.outln('typedef uint64_t khronos_utime_nanoseconds_t;') self.outln('typedef uint64_t khronos_utime_nanoseconds_t;')
self.outln('typedef int64_t khronos_stime_nanoseconds_t;') self.outln('typedef int64_t khronos_stime_nanoseconds_t;')
self.outln('#define KHRONOS_MAX_ENUM 0x7FFFFFFF') self.outln('#define KHRONOS_MAX_ENUM 0x7FFFFFFF')

Loading…
Cancel
Save