Micah Cowan <[email protected]> writes: > Hrvoje Niksic wrote: >> Micah Cowan <[email protected]> writes: >> >>> Hm... well, what about a check for C99 first, and then a fallback on >>> checking for HAVE_STDINT_H? >> >> Isn't HAVE_STDINT_H a C99 thing? C89 doesn't seem to mention it. > > I thought HAVE_STDINT_H is more a configure-script thing...
Sorry, I meant stdint.h, the header file. The code was careful to test for stdint.h and if not found, it would assume that pointers fit into unsigned long. It still seems like a reasonable assumption (lacking proper uintptr_t, at least), and I don't understand how exactly it failed on Interix. To fail, the system would need to both not support stdint.h in any form, and have Win64-style pointers larger than longs. Possible, but not very likely. > There's the other possibility, of trying to avoid casting a pointer > to an integer type in the first place. I haven't looked much at this > code, though, and honestly probably won't any time real soon. The code casts pointer to integer in two places: the first is to implement an "invalid pointer" constant, and the second to hash a pointer value by identity. I'm not sure if you can eliminate uintptr_t from those places without essentially reinventing it.
