turn ptrdiff_t into a 64 bit type
while technically a 32 bit ptrdiff_t is in spec on systems with 64 bit ponters as long as we guarantee that individual objects are small enough, this can confuse legitimate code, so lets fix this.
This commit is contained in:
parent
0e1fec841e
commit
2f67e21393
3 changed files with 19 additions and 1 deletions
7
amd64/include/ape/stddef.h
Normal file
7
amd64/include/ape/stddef.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifndef __STDDEF_ARCH_H
|
||||
#define __STDDEF_ARCH_H
|
||||
|
||||
typedef long long _ptrdiff_t;
|
||||
#include "/sys/include/ape/stddef.h"
|
||||
|
||||
#endif /* __STDDEF_ARCH_H */
|
7
arm64/include/ape/stddef.h
Normal file
7
arm64/include/ape/stddef.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifndef __STDDEF_ARCH_H
|
||||
#define __STDDEF_ARCH_H
|
||||
|
||||
typedef long long _ptrdiff_t;
|
||||
#include "/sys/include/ape/stddef.h"
|
||||
|
||||
#endif /* __STDDEF_ARCH_H */
|
|
@ -1,6 +1,10 @@
|
|||
#ifndef __STDDEF_H
|
||||
#define __STDDEF_H
|
||||
|
||||
#ifndef __STDDEF_ARCH_H
|
||||
typedef long _ptrdiff_t;
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0
|
||||
|
@ -10,7 +14,7 @@
|
|||
#endif
|
||||
#define offsetof(ty,mem) ((size_t) &(((ty *)0)->mem))
|
||||
|
||||
typedef long ptrdiff_t;
|
||||
typedef _ptrdiff_t ptrdiff_t;
|
||||
#ifndef _SIZE_T
|
||||
#define _SIZE_T
|
||||
typedef unsigned long size_t;
|
||||
|
|
Loading…
Reference in a new issue