configure: include stddef.h for NULL
PATCH v2 1/1 configure: include stddef.h for NULL
This fixes an observed failure to detect madvise() on Linux.
To avoid similar issues, all other tests that use NULL but don't already have stddef.h (or another header that is defined to provide NULL, such as stdio.h, unistd.h, or time.h) are also fixed.
---
This version doesn't add stddef.h where another header is defined to provide NULL.
configure | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
configure +5 -0
@@ -1319,6 +1319,7 @@ if test "$vnc_png" != "no" ; then cat > $TMPC <<EOF //#include <stdio.h> #include <png.h> +#include <stddef.h> int main(void) { png_structp png_ptr; png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
@@ -1503,6 +1504,7 @@ if test "$brlapi" != "no" ; then brlapi_libs="-lbrlapi" cat > $TMPC << EOF #include <brlapi.h> +#include <stddef.h> int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } EOF if compile_prog "" "$brlapi_libs" ; then
@@ -1737,6 +1739,7 @@ if test "$linux_aio" != "no" ; then cat > $TMPC <<EOF #include <libaio.h> #include <sys/eventfd.h> +#include <stddef.h> int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } EOF if compile_prog "" "-laio" ; then
@@ -2094,6 +2097,7 @@ madvise=no cat > $TMPC << EOF #include <sys/types.h> #include <sys/mman.h> +#include <stddef.h> int main(void) { return madvise(NULL, 0, MADV_DONTNEED); } EOF if compile_prog "" "" ; then
@@ -2106,6 +2110,7 @@ fi posix_madvise=no cat > $TMPC << EOF #include <sys/mman.h> +#include <stddef.h> int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } EOF if compile_prog "" "" ; then
Signature · 1 line
1.7.0.4
Blue Swirl
AppliedThanks, applied.
Quoted 63 lines · Scott Wood
This fixes an observed failure to detect
madvise()on Linux.To avoid similar issues, all other tests that use NULL but don't already have
stddef.h(or another header that is defined to provide NULL, such asstdio.h,unistd.h, ortime.h) are also fixed.Signed-off-by Scott Wood <[email protected]>---
This version doesn't addstddef.hwhere another header is defined to provide NULL.configure | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)configure +0
-0@@ -1319,6 +1319,7 @@ if test "$vnc_png" != "no" ; thencat > $TMPC <<EOF
//#include <stdio.h>
#include <png.h>
+#include <stddef.h>
int main(void) {
png_structppng_ptr;
png_ptr=png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);configure +0
-0@@ -1503,6 +1504,7 @@ if test "$brlapi" != "no" ; thenbrlapi_libs="-lbrlapi"
cat > $TMPC << EOF
#include <brlapi.h>
+#include <stddef.h>
int main( void ) { returnbrlapi__openConnection(NULL, NULL, NULL); } EOF
ifcompile_prog"" "$brlapi_libs" ; thenconfigure +0
-0@@ -1737,6 +1739,7 @@ if test "$linux_aio" != "no" ; thencat > $TMPC <<EOF
#include <libaio.h>
#include <sys/eventfd.h>
+#include <stddef.h>
int main(void) {io_setup(0, NULL);io_set_eventfd(NULL, 0);eventfd(0, 0); return 0; } EOF
ifcompile_prog"" "-laio" ; thenconfigure +0
-0@@ -2094,6 +2097,7 @@ madvise=nocat > $TMPC << EOF
#include <sys/types.h>
#include <sys/mman.h>
+#include <stddef.h>
int main(void) { returnmadvise(NULL, 0, MADV_DONTNEED); } EOF
ifcompile_prog"" "" ; thenconfigure +0
-0@@ -2106,6 +2110,7 @@ fiposix_madvise=no
cat > $TMPC << EOF
#include <sys/mman.h>
+#include <stddef.h>
int main(void) { returnposix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } EOF
ifcompile_prog"" "" ; then
--
1.7.0.4