Move INT_FMT, etc. declaration into global mpconfig.h .
This in particular makes it available for stm port.
This commit is contained in:
parent
b7aa72710e
commit
c90c0f68a2
|
@ -4,6 +4,20 @@
|
||||||
|
|
||||||
#include <mpconfigport.h>
|
#include <mpconfigport.h>
|
||||||
|
|
||||||
|
#ifndef INT_FMT
|
||||||
|
// printf format spec to use for machine_int_t and friends
|
||||||
|
#ifdef __LP64__
|
||||||
|
// Archs where machine_int_t == long, long != int
|
||||||
|
#define UINT_FMT "%lu"
|
||||||
|
#define INT_FMT "%ld"
|
||||||
|
#else
|
||||||
|
// Archs where machine_int_t == int
|
||||||
|
#define UINT_FMT "%u"
|
||||||
|
#define INT_FMT "%d"
|
||||||
|
#endif
|
||||||
|
#endif //INT_FMT
|
||||||
|
|
||||||
|
|
||||||
// Any options not explicitly set in mpconfigport.h will get default
|
// Any options not explicitly set in mpconfigport.h will get default
|
||||||
// values below.
|
// values below.
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,11 @@
|
||||||
#ifdef __LP64__
|
#ifdef __LP64__
|
||||||
typedef long machine_int_t; // must be pointer size
|
typedef long machine_int_t; // must be pointer size
|
||||||
typedef unsigned long machine_uint_t; // must be pointer size
|
typedef unsigned long machine_uint_t; // must be pointer size
|
||||||
#define UINT_FMT "%lu"
|
|
||||||
#define INT_FMT "%ld"
|
|
||||||
#else
|
#else
|
||||||
// These are definitions for machines where sizeof(int) == sizeof(void*),
|
// These are definitions for machines where sizeof(int) == sizeof(void*),
|
||||||
// regardless for actual size.
|
// regardless for actual size.
|
||||||
typedef int machine_int_t; // must be pointer size
|
typedef int machine_int_t; // must be pointer size
|
||||||
typedef unsigned int machine_uint_t; // must be pointer size
|
typedef unsigned int machine_uint_t; // must be pointer size
|
||||||
#define UINT_FMT "%u"
|
|
||||||
#define INT_FMT "%d"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BYTES_PER_WORD sizeof(machine_int_t)
|
#define BYTES_PER_WORD sizeof(machine_int_t)
|
||||||
|
|
|
@ -11,15 +11,11 @@
|
||||||
#ifdef __LP64__
|
#ifdef __LP64__
|
||||||
typedef long machine_int_t; // must be pointer size
|
typedef long machine_int_t; // must be pointer size
|
||||||
typedef unsigned long machine_uint_t; // must be pointer size
|
typedef unsigned long machine_uint_t; // must be pointer size
|
||||||
#define UINT_FMT "%lu"
|
|
||||||
#define INT_FMT "%ld"
|
|
||||||
#else
|
#else
|
||||||
// These are definitions for machines where sizeof(int) == sizeof(void*),
|
// These are definitions for machines where sizeof(int) == sizeof(void*),
|
||||||
// regardless for actual size.
|
// regardless for actual size.
|
||||||
typedef int machine_int_t; // must be pointer size
|
typedef int machine_int_t; // must be pointer size
|
||||||
typedef unsigned int machine_uint_t; // must be pointer size
|
typedef unsigned int machine_uint_t; // must be pointer size
|
||||||
#define UINT_FMT "%u"
|
|
||||||
#define INT_FMT "%d"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BYTES_PER_WORD sizeof(machine_int_t)
|
#define BYTES_PER_WORD sizeof(machine_int_t)
|
||||||
|
|
Loading…
Reference in New Issue