VirtualBox

source: vbox/trunk/include/iprt/nocrt/compiler/gcc.h@ 2356

Last change on this file since 2356 was 666, checked in by vboxsync, 18 years ago

Messing with the nocrt setup...

  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1/* A quick hack for freebsd where there are no separate location
2 for compiler specific headers like on linux, mingw, os2, ++.
3 This file will be cleaned up later... */
4
5#ifndef __nocrt_compiler_gcc_h__
6#define __nocrt_compiler_gcc_h__
7
8
9/* stddef.h */
10#ifdef __PTRDIFF_TYPE__
11typedef __PTRDIFF_TYPE__ ptrdiff_t;
12#elif ARCH_BITS == 32
13typedef int32_t ptrdiff_t;
14#elif ARCH_BITS == 64
15typedef int64_t ptrdiff_t;
16#else
17# error "ARCH_BITS is undefined or incorrect."
18#endif
19#define _PTRDIFF_T_DECLARED
20
21#ifdef __SIZE_TYPE__
22typedef __SIZE_TYPE__ size_t;
23#elif ARCH_BITS == 32
24typedef uint32_t size_t;
25#elif ARCH_BITS == 64
26typedef uint64_t size_t;
27#else
28# error "ARCH_BITS is undefined or incorrect."
29#endif
30#define _SIZE_T_DECLARED
31
32#ifndef __cplusplus
33# ifdef __WCHAR_TYPE__
34typedef __WCHAR_TYPE__ wchar_t;
35# elif defined(__OS2__) || defined(__WIN__)
36typedef uint16_t wchar_t;
37# else
38typedef int wchar_t;
39# endif
40# define _WCHAR_T_DECLARED
41#endif
42
43#ifdef __WINT_TYPE__
44typedef __WINT_TYPE__ wint_t;
45#else
46typedef unsigned int wint_t;
47#endif
48#define _WINT_T_DECLARED
49
50#ifndef NULL
51# ifdef __cplusplus
52# define NULL 0
53# else
54# define NULL ((void *)0)
55# endif
56#endif
57
58
59#ifndef offsetof
60# if defined(__cplusplus) && defined(__offsetof__)
61# define offsetof(type, memb)
62 (__offsetof__ (reinterpret_cast<size_t>(&reinterpret_cast<const volatile char &>(static_cast<type *>(0)->memb))) )
63# else
64# define offsetof(type, memb) ((size_t)&((type *)0)->memb)
65# endif
66#endif
67
68
69/* sys/types.h */
70#ifdef __SSIZE_TYPE__
71typedef __SSIZE_TYPE__ ssize_t;
72#elif ARCH_BITS == 32
73typedef int32_t ssize_t;
74#elif ARCH_BITS == 64
75typedef int64_t ssize_t;
76#else
77# define ARCH_BITS 123123
78# error "ARCH_BITS is undefined or incorrect."
79#endif
80#define _SSIZE_T_DECLARED
81
82
83/* stdarg.h */
84typedef __builtin_va_list va_list;
85#define va_start(va, arg) __builtin_va_start(va, arg)
86#define va_end(va) __builtin_va_end(va)
87#define va_arg(va, type) __builtin_va_arg(va, type)
88#define va_copy(dst, src) __builtin_va_copy(dst, src)
89
90
91#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette