Bug 450 – frontend: please use <stdint.h> to increase portability

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-10-24T06:28:00Z
Last change time
2014-02-15T13:20:30Z
Keywords
patch
Assigned to
bugzilla
Creator
thomas-dloop

Comments

Comment #0 by thomas-dloop — 2006-10-24T06:28:33Z
The patch below takes care of defining the d_<integer> types in a portable way. === dmd/mars.h ================================================================== --- dmd/mars.h (revision 2010) +++ dmd/mars.h (local) @@ -138,21 +138,23 @@ #endif #endif +#include <stdint.h> + // Be careful not to care about sign with integer_t -typedef unsigned long long integer_t; +typedef uint64_t integer_t; // Signed and unsigned variants -typedef long long sinteger_t; -typedef unsigned long long uinteger_t; +typedef int64_t sinteger_t; +typedef uint64_t uinteger_t; -typedef signed char d_int8; -typedef unsigned char d_uns8; -typedef short d_int16; -typedef unsigned short d_uns16; -typedef int d_int32; -typedef unsigned d_uns32; -typedef long long d_int64; -typedef unsigned long long d_uns64; +typedef int8_t d_int8; +typedef uint8_t d_uns8; +typedef int16_t d_int16; +typedef uint16_t d_uns16; +typedef int32_t d_int32; +typedef uint32_t d_uns32; +typedef int64_t d_int64; +typedef uint64_t d_uns64; typedef float d_float32; typedef double d_float64;
Comment #1 by bugzilla — 2006-11-09T02:18:51Z
Incorporated DMD 0.173