* src/vm/types.h: Saner defines for internal types (s1, u1, s4, u4, s8, ...)
authorStefan Ring <stefan@complang.tuwien.ac.at>
Tue, 13 Oct 2009 17:28:02 +0000 (19:28 +0200)
committerStefan Ring <stefan@complang.tuwien.ac.at>
Tue, 13 Oct 2009 17:28:02 +0000 (19:28 +0200)
src/vm/types.h

index 8282b082ebcf17fae0f82ccf1535ce20d867a836..3a775bfe09f6c526ef77334d65f4d9525f3f6c90 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/types.h - type definitions for CACAO's internal types
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
-   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-   J. Wenninger, Institut f. Computersprachen - TU Wien
+   Copyright (C) 1996-2005, 2006, 2007, 2008, 2009
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Reinhard Grafl
-            Andreas  Krall
-
-   Changes: Christian Thalinger
-
 */
 
 
 
 #include "config.h"
 
+#include <stdint.h>
+
 
 /* In this file we check for unknown pointersizes, so we don't have to
    do this somewhere else. */
 
 /* Define the sizes of the integer types used internally by CACAO. ************/
 
-typedef signed char             s1;
-typedef unsigned char           u1;
-typedef signed short int        s2;
-typedef unsigned short int      u2;
+typedef int8_t            s1;
+typedef uint8_t           u1;
+
+typedef int16_t           s2;
+typedef uint16_t          u2;
 
-typedef signed int              s4;
-typedef unsigned int            u4;
+typedef int32_t           s4;
+typedef uint32_t          u4;
 
-#if SIZEOF_VOID_P == 8
-typedef signed long int         s8;
-typedef unsigned long int       u8;
-#elif SIZEOF_VOID_P == 4
-typedef signed long long int    s8;
-typedef unsigned long long int  u8;
-#else
-#error unknown pointer size
-#endif
+typedef int64_t           s8;
+typedef uint64_t          u8;
 
 
 /* Define the size of a function pointer used in function pointer casts. ******/
 
-#if SIZEOF_VOID_P == 8
-typedef u8                      ptrint;
-#else
-typedef u4                      ptrint;
-#endif
+typedef uintptr_t                      ptrint;
 
 #endif /* _CACAO_TYPES_H */