X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fstddef.h;h=4e74fa6178e80b155a776b77b2c90d3d9e7d1b4b;hb=2e8d8e1e1d4aa9c90b78c6d40bc315dd4e5270b9;hp=836b8f21c1dfc8dab191894c4572fb97d7e7a45f;hpb=f2f8875638593bd5365cfd6a5ba7c9578e52322f;p=pintos-anon diff --git a/src/lib/stddef.h b/src/lib/stddef.h index 836b8f2..4e74fa6 100644 --- a/src/lib/stddef.h +++ b/src/lib/stddef.h @@ -1,9 +1,12 @@ -#ifndef LIB_STDDEF_H -#define LIB_STDDEF_H +#ifndef __LIB_STDDEF_H +#define __LIB_STDDEF_H #define NULL ((void *) 0) #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) -typedef int ptrdiff_t; -typedef unsigned int size_t; + +/* GCC predefines the types we need for ptrdiff_t and size_t, + so that we don't have to guess. */ +typedef __PTRDIFF_TYPE__ ptrdiff_t; +typedef __SIZE_TYPE__ size_t; #endif /* lib/stddef.h */