mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 05:55:46 +08:00
size_t should be 64-bits on a 64-bit machine. mmsize_t should be 32-bits (unless CONFIG_MM_SMALL is selected). This commit backs out the last change to stddef.h
This commit is contained in:
@@ -11140,3 +11140,9 @@
|
|||||||
of the block driver (2015-11-21).
|
of the block driver (2015-11-21).
|
||||||
* libc/stdio/lib_freopen.c and include/stdio.h: Add support for
|
* libc/stdio/lib_freopen.c and include/stdio.h: Add support for
|
||||||
freopen() (2015-11-22).
|
freopen() (2015-11-22).
|
||||||
|
* include/sys/types.h and include/nuttx/mm.h: When building on a 64-bit
|
||||||
|
machine, the size of size_t should be 64-bits. In general, I believe
|
||||||
|
that sizeof(size_t) should be the same as sizeof(uinptr_t). mmsize_t
|
||||||
|
should always be 32-bits in any event. The last change to stddef has
|
||||||
|
been backed out. With these changes, the simulator builds without
|
||||||
|
warnings on a 64-bit machine (2015-11-23).
|
||||||
|
|||||||
+1
-1
Submodule arch updated: b417eaa97e...ffcd26aff9
+1
-1
Submodule configs updated: 48b7ae421b...82d56af701
@@ -186,7 +186,7 @@
|
|||||||
typedef uint16_t mmsize_t;
|
typedef uint16_t mmsize_t;
|
||||||
# define MMSIZE_MAX 0xffff
|
# define MMSIZE_MAX 0xffff
|
||||||
#else
|
#else
|
||||||
typedef size_t mmsize_t;
|
typedef uint32_t mmsize_t;
|
||||||
# define MMSIZE_MAX SIZE_MAX
|
# define MMSIZE_MAX SIZE_MAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@
|
|||||||
* Reference: Opengroup.org
|
* Reference: Opengroup.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define offsetof(type, member) ((size_t)(uintptr_t)&(((type *)0)->member))
|
#define offsetof(a, b) ((size_t)(&(((a *)(0))->b)))
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Type Definitions
|
* Type Definitions
|
||||||
|
|||||||
+7
-3
@@ -142,10 +142,14 @@ typedef int16_t ssize_t;
|
|||||||
typedef uint16_t rsize_t;
|
typedef uint16_t rsize_t;
|
||||||
|
|
||||||
#else /* CONFIG_SMALL_MEMORY */
|
#else /* CONFIG_SMALL_MEMORY */
|
||||||
|
/* As a general rule, the size of size_t should be the same as the size of
|
||||||
|
* uintptr_t: 32-bits on a machine with 32-bit addressing but 64-bits on a
|
||||||
|
* machine with 64-bit addressing.
|
||||||
|
*/
|
||||||
|
|
||||||
typedef uint32_t size_t;
|
typedef uintptr_t size_t;
|
||||||
typedef int32_t ssize_t;
|
typedef intptr_t ssize_t;
|
||||||
typedef uint32_t rsize_t;
|
typedef uintptr_t rsize_t;
|
||||||
|
|
||||||
#endif /* CONFIG_SMALL_MEMORY */
|
#endif /* CONFIG_SMALL_MEMORY */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user