[libc] Update size_t and ssize_t definitions to use __SIZE_TYPE__ and __PTRDIFF_TYPE__ respectively. (#143921)
The current definition of `ssize_t` does not have the same bit width as `size_t` on 32-bit platforms.
This commit is contained in:
parent
53e50472ff
commit
82f19674bf
@ -9,11 +9,6 @@
|
||||
#ifndef LLVM_LIBC_TYPES_SIZE_T_H
|
||||
#define LLVM_LIBC_TYPES_SIZE_T_H
|
||||
|
||||
// Since __need_size_t is defined, we get the definition of size_t from the
|
||||
// standalone C header stddef.h. Also, because __need_size_t is defined,
|
||||
// including stddef.h will pull only the type size_t and nothing else.
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
#undef __need_size_t
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
|
||||
#endif // LLVM_LIBC_TYPES_SIZE_T_H
|
||||
|
@ -9,6 +9,6 @@
|
||||
#ifndef LLVM_LIBC_TYPES_SSIZE_T_H
|
||||
#define LLVM_LIBC_TYPES_SSIZE_T_H
|
||||
|
||||
typedef __INT64_TYPE__ ssize_t;
|
||||
typedef __PTRDIFF_TYPE__ ssize_t;
|
||||
|
||||
#endif // LLVM_LIBC_TYPES_SSIZE_T_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user