From f733203dfbd034a6b1aa3eb2cd616437c982c435 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 17 Jul 2011 16:34:39 +0200 Subject: GlueGen proper size / alignment of primitive and compound types usage [1/2] - Preparation. Currently GlueGen fails for type long (size) and some alignments (see package.html). - The size and alignment values shall be queried at runtime. - Compound alignment needs to follow the described natural alignment (also @runtime). - - Build - add Linux Arm7 (EABI) - junit test - added compound/struct tests, pointing out the shortcomings of current impl. - package.html - Added alignment documentation - remove intptr.cfg - add GluGen types int8_t, int16_t, uint8_t, uint16_t - move MachineDescription* into runtime - Platform - has runtime MachineDescription - moved size, .. to MachineDescription - use enums for OSType, CPUArch and CPUType defined by os.name/os.arch, triggering exception if os/arch is not supported. This avoids Java String comparison and conscious os/arch detection. - MachineDescription: - compile time instances MachineDescription32Bits, MachineDescription64Bits - runtime queried instance MachineDescriptionRuntime - correct size, alignment, page size, .. --- make/stub_includes/gluegen/gluegen_types.h | 4 ++++ make/stub_includes/platform/gluegen_stdint.h | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'make/stub_includes') diff --git a/make/stub_includes/gluegen/gluegen_types.h b/make/stub_includes/gluegen/gluegen_types.h index d1f003a..3df8eb4 100644 --- a/make/stub_includes/gluegen/gluegen_types.h +++ b/make/stub_includes/gluegen/gluegen_types.h @@ -24,6 +24,10 @@ * * The following types are build-in: * + * int8_t - stdint.h + * uint8_t - stdint.h + * int16_t - stdint.h + * uint16_t - stdint.h * __int32 - windows * int32_t - stdint.h * wchar_t - stddef.h diff --git a/make/stub_includes/platform/gluegen_stdint.h b/make/stub_includes/platform/gluegen_stdint.h index 1dd712b..8b1dbe3 100644 --- a/make/stub_includes/platform/gluegen_stdint.h +++ b/make/stub_includes/platform/gluegen_stdint.h @@ -10,14 +10,22 @@ #elif defined(WIN32) && defined(__GNUC__) #include #elif defined(_WIN64) + typedef signed char int8_t; + typedef unsigned char uint8_t; + typedef signed short int16_t; + typedef unsigned short uint16_t; typedef __int32 int32_t; typedef unsigned __int32 uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; - typedef __int64 intptr_t; - typedef unsigned __int64 uintptr_t; + typedef __int64 intptr_t; + typedef unsigned __int64 uintptr_t; #elif defined(_WIN32) + typedef signed char int8_t; + typedef unsigned char uint8_t; + typedef signed short int16_t; + typedef unsigned short uint16_t; typedef __int32 int32_t; typedef unsigned __int32 uint32_t; typedef __int64 int64_t; @@ -26,6 +34,10 @@ typedef __int32 intptr_t; typedef unsigned __int32 uintptr_t; #elif defined(__ia64__) || defined(__x86_64__) + typedef signed char int8_t; + typedef unsigned char uint8_t; + typedef signed short int16_t; + typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef signed long int64_t; @@ -34,6 +46,10 @@ typedef long intptr_t; typedef unsigned long uintptr_t; #else + typedef signed char int8_t; + typedef unsigned char uint8_t; + typedef signed short int16_t; + typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef signed long long int64_t; -- cgit v1.2.3