stddef include in gmp.h

Marc Glisse marc.glisse at inria.fr
Tue Oct 8 11:00:38 CEST 2013


On Mon, 7 Oct 2013, Clemens wrote:

> Hi GMP developers,
>
> on Mac OS X 10.9 the build of GMP 5.1.2 failed, because ptrdiff_t was not exported from stddef.h.
> In http://gmplib.org:8000/gmp/file/fff25440e878/gmp-h.in#l49 you define __need_size_t.
>
> Could you please either also #define __need_ptrdiff_t or remove the __need_size_t definition?
> Or would adding it create problems on other systems?

We currently have:

#define __need_size_t  /* tell gcc stddef.h we only want size_t */
#if defined (__cplusplus)
#include <cstddef>     /* for size_t */
#else
#include <stddef.h>    /* for size_t */
#endif
#undef __need_size_t

We should at least move the __need_size_t stuff so it only applies to 
stddef.h (not cstddef), or preferably remove it completely, it isn't worth 
the trouble. I am quite sure we already discussed that, but didn't get 
around to it yet.

-- 
Marc Glisse


More information about the gmp-discuss mailing list