Skip to content

Commit 132a534

Browse files
Remove lots of unneeded definitions from core.h
All out platforms supply the required C standard library headers; just use them directly instead.
1 parent 85a7444 commit 132a534

File tree

1 file changed

+6
-86
lines changed

1 file changed

+6
-86
lines changed

libcore/include/core.h

Lines changed: 6 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -34,82 +34,16 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
3434

3535
////////////////////////////////////////////////////////////////////////////////
3636

37-
#ifndef _STDARG_H
3837
#include <stdarg.h>
39-
#endif
40-
4138
#include <math.h>
42-
43-
////////////////////////////////////////////////////////////////////////////////
44-
45-
#ifndef _WIN32
39+
#include <stddef.h>
4640
#include <stdint.h>
47-
#else
48-
49-
typedef unsigned char uint8_t;
50-
typedef signed char int8_t;
51-
typedef unsigned short uint16_t;
52-
typedef signed short int16_t;
53-
typedef unsigned int uint32_t;
54-
typedef signed int int32_t;
55-
56-
// MDW 2013-04.15: only typedef if necessary
57-
#if !defined(uint64_t)
58-
#ifdef __LP64__
59-
typedef unsigned long int uint64_t;
60-
#else
61-
typedef unsigned long long int uint64_t;
62-
#endif
63-
#endif
64-
65-
#if !defined(int64_t)
66-
#ifdef __LP64__
67-
typedef long int int64_t;
68-
#else
69-
typedef long long int int64_t;
70-
#endif
71-
#endif
72-
73-
#endif
7441

7542
typedef uint32_t uindex_t;
7643
typedef int32_t index_t;
7744
typedef uint32_t hash_t;
7845
typedef int32_t compare_t;
7946

80-
#if (defined(_MACOSX) || defined(TARGET_SUBPLATFORM_IPHONE)) && !defined(_SIZE_T)
81-
typedef long unsigned int size_t;
82-
#endif
83-
84-
#if defined(_LINUX) && !defined(_SIZE_T)
85-
// MDW-2013-04-15: [[ x64 ]] make 64-bit safe
86-
#ifdef __LP64__
87-
typedef long unsigned int size_t;
88-
#else
89-
typedef unsigned int size_t;
90-
#endif
91-
#endif
92-
93-
#ifndef _UINTPTR_T
94-
#define _UINTPTR_T
95-
// MDW-2013-04-15: [[ x64 ]] make 64-bit safe
96-
#ifdef __LP64__
97-
typedef uint64_t uintptr_t;
98-
#else
99-
typedef uint32_t uintptr_t;
100-
#endif
101-
#endif
102-
103-
#ifndef _INTPTR_T
104-
#define _INTPTR_T
105-
// MDW-2013-04-15: [[ x64 ]] make 64-bit safe
106-
#ifdef __LP64__
107-
typedef int64_t intptr_t;
108-
#else
109-
typedef int32_t intptr_t;
110-
#endif
111-
#endif
112-
11347
typedef char char_t;
11448

11549
#if defined(_WIN32) || defined(_WINCE)
@@ -125,31 +59,17 @@ typedef const struct __CFData * CFDataRef;
12559
#endif
12660

12761
#ifndef nil
128-
#define nil 0
62+
# ifdef __cplusplus
63+
# define nil nullptr
64+
# else
65+
# define nil 0
66+
# endif
12967
#endif
13068

13169
#if defined(_MACOSX) && defined(__LP64__)
13270
#define _MACOSX_NOCARBON
13371
#endif
13472

135-
#if defined(_WINDOWS)
136-
typedef char *va_list;
137-
#elif defined(_MACOSX)
138-
typedef __builtin_va_list va_list;
139-
#elif defined(_LINUX)
140-
typedef __builtin_va_list va_list;
141-
#elif defined(__EMSCRIPTEN__)
142-
typedef __builtin_va_list va_list;
143-
#endif
144-
145-
#if defined(_MOBILE) && defined(TARGET_SUBPLATFORM_ANDROID)
146-
typedef uint32_t size_t;
147-
#endif
148-
149-
#if defined(__EMSCRIPTEN__)
150-
typedef uint32_t size_t;
151-
#endif
152-
15373
// AL-2014-07-30: [[ Bug 13000 ]] Ensure ___LITTLE_ENDIAN__ is defined appropriately
15474
#ifdef __ppc__
15575
#undef __LITTLE_ENDIAN__

0 commit comments

Comments
 (0)