Fix casting bug in __INT_TO_PTR.
authorChris Hanson <org/chris-hanson/cph>
Wed, 25 Sep 1991 20:36:47 +0000 (20:36 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 25 Sep 1991 20:36:47 +0000 (20:36 +0000)
v7/src/microcode/obstack.h

index 0ab90606359bc79de6f32740930494a427bd471d..be5e42109e1f5b0550adf4076fff5771b1a89ed0 100644 (file)
@@ -103,6 +103,8 @@ Summary:
 #ifndef __OBSTACKS__
 #define __OBSTACKS__
 \f
+#include "ansidecl.h"
+
 /* We use subtraction of (char *)0 instead of casting to int
    because on word-addressable machines a simple cast to int
    may ignore the byte-within-word field of the pointer.  */
@@ -112,7 +114,7 @@ Summary:
 #endif
 
 #ifndef __INT_TO_PTR
-#define __INT_TO_PTR(P) ((P) + (char *)0)
+#define __INT_TO_PTR(P) ((PTR) ((P) + (char *)0))
 #endif
 
 struct _obstack_chunk          /* Lives at front of each chunk. */