diff options
author | YamaArashi <shadow962@live.com> | 2016-07-26 09:03:32 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-07-26 09:03:32 -0700 |
commit | 223a19fd9b279fa90e34bfcb48fbf7124b96d896 (patch) | |
tree | 283ca90d0515899e6e54cd9e97146565366b6120 /gcc | |
parent | f3580e4659c20e4f46f180d92f8b8f0211f3d855 (diff) |
maybe fix 64-bit
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/Makefile | 2 | ||||
-rwxr-xr-x | gcc/obstack.c | 2 | ||||
-rwxr-xr-x | gcc/obstack.h | 31 | ||||
-rwxr-xr-x | gcc/splay-tree.h | 6 |
4 files changed, 13 insertions, 28 deletions
diff --git a/gcc/Makefile b/gcc/Makefile index eb6d667..c30991a 100644 --- a/gcc/Makefile +++ b/gcc/Makefile @@ -24,7 +24,7 @@ VPATH = $(srcdir) CC = gcc -BASE_CFLAGS = -g -std=gnu11 -Wunused-function -m32 +BASE_CFLAGS = -g -std=gnu11 INCLUDES = -I. -I$(srcdir) diff --git a/gcc/obstack.c b/gcc/obstack.c index 408fa19..0a4cd30 100755 --- a/gcc/obstack.c +++ b/gcc/obstack.c @@ -30,7 +30,7 @@ /* Determine default alignment. */ struct fooalign {char x; double d;}; #define DEFAULT_ALIGNMENT \ - ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0)) + ((ptrdiff_t) ((char *) &((struct fooalign *) 0)->d - (char *) 0)) /* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT. But in fact it might be less smart and round addresses to as much as DEFAULT_ROUNDING. So we prepare for it to do that. */ diff --git a/gcc/obstack.h b/gcc/obstack.h index 2fb012c..02448a4 100755 --- a/gcc/obstack.h +++ b/gcc/obstack.h @@ -124,15 +124,7 @@ extern "C" { # define __INT_TO_PTR(P) ((P) + (char *) 0) #endif -/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is - defined, as with GNU C, use that; that way we don't pollute the - namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is - available, include it and use ptrdiff_t. In traditional C, long is - the best that we can do. */ - - #include <stddef.h> -#define PTR_INT_TYPE ptrdiff_t #include <string.h> #define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N)) @@ -151,7 +143,7 @@ struct obstack /* control current object in current chunk */ char *object_base; /* address of object we are building */ char *next_free; /* where to add next char to current object */ char *chunk_limit; /* address of char after current chunk */ - PTR_INT_TYPE temp; /* Temporary for some macros. */ + ptrdiff_t temp; /* Temporary for some macros. */ int alignment_mask; /* Mask of alignment for each object. */ #if defined __STDC__ && __STDC__ /* These prototypes vary based on `use_extra_arg', and we use @@ -554,21 +546,12 @@ __extension__ \ (h)->object_base = (h)->next_free, \ __INT_TO_PTR ((h)->temp)) -# if defined __STDC__ && __STDC__ -# define obstack_free(h,obj) \ -( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ - (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ - ? (int) ((h)->next_free = (h)->object_base \ - = (h)->temp + (char *) (h)->chunk) \ - : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0))) -# else -# define obstack_free(h,obj) \ -( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ - (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ - ? (int) ((h)->next_free = (h)->object_base \ - = (h)->temp + (char *) (h)->chunk) \ - : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0))) -# endif +# define obstack_free(h, obj) \ + ((h)->temp = (ptrdiff_t)(obj), \ + (((h)->temp > (ptrdiff_t)(h)->chunk \ + && (h)->temp < (ptrdiff_t)(h)->chunk_limit) \ + ? (void)((h)->next_free = (h)->object_base = (char *)(h)->temp) \ + : _obstack_free((h), (h)->temp))) #endif /* not __GNUC__ or not __STDC__ */ diff --git a/gcc/splay-tree.h b/gcc/splay-tree.h index be367a3..50c1260 100755 --- a/gcc/splay-tree.h +++ b/gcc/splay-tree.h @@ -30,12 +30,14 @@ Boston, MA 02111-1307, USA. */ #ifndef _SPLAY_TREE_H #define _SPLAY_TREE_H +#include <stdint.h> + /* Use typedefs for the key and data types to facilitate changing these types, if necessary. These types should be sufficiently wide that any pointer or scalar can be cast to these types, and then cast back, without loss of precision. */ -typedef unsigned long int splay_tree_key; -typedef unsigned long int splay_tree_value; +typedef uintptr_t splay_tree_key; +typedef uintptr_t splay_tree_value; /* Forward declaration for a node in the tree. */ typedef struct splay_tree_node *splay_tree_node; |