From cc5d3e364b888d529400738bd51adccb07001e5e Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Wed, 7 Jan 2026 18:24:06 +0300 Subject: [PATCH 1/7] Fix building without stropts.h --- Modules/posixmodule.c | 4 ++-- configure | 45 +++++++++++++++++++++++++++++++++++++------ configure.ac | 20 ++++++++++++++++++- 3 files changed, 60 insertions(+), 9 deletions(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 49214d57a2e362..4c11d4cf895e31 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -9384,13 +9384,13 @@ os_openpty_impl(PyObject *module) if (_Py_set_inheritable(master_fd, 0, NULL) < 0) goto posix_error; -#if !defined(__CYGWIN__) && !defined(__ANDROID__) && !defined(HAVE_DEV_PTC) +#if defined(HAVE_STROPTS_H) && !defined(HAVE_DEV_PTC) ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */ ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */ #ifndef __hpux ioctl(slave_fd, I_PUSH, "ttcompat"); /* push ttcompat */ #endif /* __hpux */ -#endif /* HAVE_CYGWIN */ +#endif /* defined(HAVE_STROPTS_H) && !defined(HAVE_DEV_PTC) */ #endif /* HAVE_OPENPTY */ return Py_BuildValue("(ii)", master_fd, slave_fd); diff --git a/configure b/configure index 411bc1a23226e7..2e7a086432c9fe 100755 --- a/configure +++ b/configure @@ -11455,12 +11455,6 @@ if test "x$ac_cv_header_spawn_h" = xyes then : printf "%s\n" "#define HAVE_SPAWN_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "stropts.h" "ac_cv_header_stropts_h" "$ac_includes_default" -if test "x$ac_cv_header_stropts_h" = xyes -then : - printf "%s\n" "#define HAVE_STROPTS_H 1" >>confdefs.h - fi ac_fn_c_check_header_compile "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default" if test "x$ac_cv_header_sys_audioio_h" = xyes @@ -11945,6 +11939,45 @@ fi fi +# On Linux, stropts.h may be empty +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stropts.h" >&5 +printf %s "checking for stropts.h... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include +#include + +int +main (void) +{ + +#if !defined(I_PUSH) +#error I_PUSH +#endif + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_STROPTS_H 1" >>confdefs.h + + +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + # bluetooth/bluetooth.h has been known to not compile with -std=c99. # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294 SAVE_CFLAGS=$CFLAGS diff --git a/configure.ac b/configure.ac index 9e63c8f6144c3d..dd12ed61751c80 100644 --- a/configure.ac +++ b/configure.ac @@ -3010,7 +3010,7 @@ AC_CHECK_HEADERS([ \ io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \ linux/netfilter_ipv4.h linux/random.h linux/soundcard.h linux/sched.h \ linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \ - sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \ + sched.h setjmp.h shadow.h signal.h spawn.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \ sys/endian.h sys/epoll.h sys/event.h sys/eventfd.h sys/file.h sys/ioctl.h sys/kern_control.h \ sys/loadavg.h sys/lock.h sys/memfd.h sys/mkdev.h sys/mman.h sys/modem.h sys/param.h sys/pidfd.h sys/poll.h \ sys/random.h sys/resource.h sys/select.h sys/sendfile.h sys/socket.h sys/soundcard.h sys/stat.h \ @@ -3021,6 +3021,24 @@ AC_CHECK_HEADERS([ \ AC_HEADER_DIRENT AC_HEADER_MAJOR +# On Linux, stropts.h may be empty +AC_MSG_CHECKING([for stropts.h]) +AC_COMPILE_IFELSE([ +AC_LANG_PROGRAM([[ +#include +#include +]], [[ +#if !defined(I_PUSH) +#error I_PUSH +#endif +]] +)], +[ +AC_MSG_RESULT([yes]) +AC_DEFINE([HAVE_STROPTS_H], [1], [Define to 1 if you have the header file.]) +], +[AC_MSG_RESULT([no])]) + # bluetooth/bluetooth.h has been known to not compile with -std=c99. # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294 SAVE_CFLAGS=$CFLAGS From 2410cb6d2fd5853f4bbf50a58abe57cc9fc205a4 Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Thu, 8 Jan 2026 16:31:27 +0300 Subject: [PATCH 2/7] Switch to `AC_CHECK_DECL` --- configure | 286 ++++++++++++++++++++++++--------------------------- configure.ac | 20 ++-- 2 files changed, 138 insertions(+), 168 deletions(-) diff --git a/configure b/configure index 2e7a086432c9fe..01353a86a95e49 100755 --- a/configure +++ b/configure @@ -2335,6 +2335,60 @@ fi } # ac_fn_c_try_run +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in #( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl + # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -2653,60 +2707,6 @@ printf "%s\n" "$ac_res" >&6; } } # ac_fn_c_check_func -# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR -# ------------------------------------------------------------------ -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. -ac_fn_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -printf %s "checking whether $as_decl_name is declared... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - eval ac_save_FLAGS=\$$6 - as_fn_append $6 " $5" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else case e in #( - e) eval "$3=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - eval $6=\$ac_save_FLAGS - ;; -esac -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_check_decl - # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including @@ -11940,43 +11940,104 @@ fi # On Linux, stropts.h may be empty -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stropts.h" >&5 -printf %s "checking for stropts.h... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include -#include - int main (void) { +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : -#if !defined(I_PUSH) -#error I_PUSH -#endif +else case e in #( + e) # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See 'config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "I_PUSH" "ac_cv_have_decl_I_PUSH" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_I_PUSH" = xyes then : -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_STROPTS_H 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # bluetooth/bluetooth.h has been known to not compile with -std=c99. # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294 @@ -20514,89 +20575,6 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 -printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } -if test ${ac_cv_c_undeclared_builtin_options+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CFLAGS=$CFLAGS - ac_cv_c_undeclared_builtin_options='cannot detect' - for ac_arg in '' -fno-builtin; do - CFLAGS="$ac_save_CFLAGS $ac_arg" - # This test program should *not* compile successfully. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -(void) strchr; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else case e in #( - e) # This test program should compile successfully. - # No library function is consistently available on - # freestanding implementations, so test against a dummy - # declaration. Include always-available headers on the - # off chance that they somehow elicit warnings. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -extern void ac_decl (int, char *); - -int -main (void) -{ -(void) ac_decl (0, (char *) 0); - (void) ac_decl; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - if test x"$ac_arg" = x -then : - ac_cv_c_undeclared_builtin_options='none needed' -else case e in #( - e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; -esac -fi - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - done - CFLAGS=$ac_save_CFLAGS - ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 -printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } - case $ac_cv_c_undeclared_builtin_options in #( - 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error $? "cannot make $CC report undeclared builtins -See 'config.log' for more details" "$LINENO" 5; } ;; #( - 'none needed') : - ac_c_undeclared_builtin_options='' ;; #( - *) : - ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; -esac - ac_fn_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include #include " "$ac_c_undeclared_builtin_options" "CFLAGS" diff --git a/configure.ac b/configure.ac index dd12ed61751c80..73242c34d9901e 100644 --- a/configure.ac +++ b/configure.ac @@ -3022,22 +3022,14 @@ AC_HEADER_DIRENT AC_HEADER_MAJOR # On Linux, stropts.h may be empty -AC_MSG_CHECKING([for stropts.h]) -AC_COMPILE_IFELSE([ -AC_LANG_PROGRAM([[ +AC_CHECK_DECL([I_PUSH], [ +AC_DEFINE([HAVE_STROPTS_H], [1], [Define to 1 if you have the header file.]) +], [], [ +#ifdef HAVE_SYS_TYPES_H #include -#include -]], [[ -#if !defined(I_PUSH) -#error I_PUSH #endif -]] -)], -[ -AC_MSG_RESULT([yes]) -AC_DEFINE([HAVE_STROPTS_H], [1], [Define to 1 if you have the header file.]) -], -[AC_MSG_RESULT([no])]) +#include +]) # bluetooth/bluetooth.h has been known to not compile with -std=c99. # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294 From 2cbad39a58c69f6cd6a2fc2f392a225f852f16b9 Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Thu, 8 Jan 2026 22:18:09 +0300 Subject: [PATCH 3/7] fix style --- configure.ac | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 73242c34d9901e..7a2d00b2c1dcdd 100644 --- a/configure.ac +++ b/configure.ac @@ -3022,9 +3022,7 @@ AC_HEADER_DIRENT AC_HEADER_MAJOR # On Linux, stropts.h may be empty -AC_CHECK_DECL([I_PUSH], [ -AC_DEFINE([HAVE_STROPTS_H], [1], [Define to 1 if you have the header file.]) -], [], [ +AC_CHECK_DECL([I_PUSH], [AC_DEFINE([HAVE_STROPTS_H], [1], [Define to 1 if you have the header file.])], [], [ #ifdef HAVE_SYS_TYPES_H #include #endif From 7f8793ff0195ef03e29a38ce8acf6d5a76729aa8 Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Thu, 8 Jan 2026 22:27:29 +0300 Subject: [PATCH 4/7] Add News --- .../next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst diff --git a/Misc/NEWS.d/next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst b/Misc/NEWS.d/next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst new file mode 100644 index 00000000000000..551a9f1d754fb6 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst @@ -0,0 +1 @@ +Fix building without `stropts.h` or empty `stropts.h` From 93ceb4e828fccc13dd17ea86cf55aae36581c99e Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Thu, 8 Jan 2026 22:29:41 +0300 Subject: [PATCH 5/7] regen-configure --- configure | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure b/configure index 01353a86a95e49..5be9622aaa8b63 100755 --- a/configure +++ b/configure @@ -12033,10 +12033,8 @@ ac_fn_check_decl "$LINENO" "I_PUSH" "ac_cv_have_decl_I_PUSH" " if test "x$ac_cv_have_decl_I_PUSH" = xyes then : - printf "%s\n" "#define HAVE_STROPTS_H 1" >>confdefs.h - fi # bluetooth/bluetooth.h has been known to not compile with -std=c99. From 85b709e9b811956d8e7ec1ee71799922a32384fb Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Fri, 9 Jan 2026 10:16:16 +0300 Subject: [PATCH 6/7] fix lint --- .../next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst b/Misc/NEWS.d/next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst index 551a9f1d754fb6..538995538d7da8 100644 --- a/Misc/NEWS.d/next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst +++ b/Misc/NEWS.d/next/Build/2026-01-08-22-27-07.gh-issue-85277.TotySi.rst @@ -1 +1 @@ -Fix building without `stropts.h` or empty `stropts.h` +Fix building without ``stropts.h`` or empty ``stropts.h`` From ba8f793be6c9cdb0ed50d2cff43036d450a15c84 Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Fri, 9 Jan 2026 22:10:39 +0300 Subject: [PATCH 7/7] fix style --- configure | 9 +++++---- configure.ac | 12 +++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 5be9622aaa8b63..5d632aedb62cbc 100755 --- a/configure +++ b/configure @@ -12024,15 +12024,16 @@ See 'config.log' for more details" "$LINENO" 5; } ;; #( esac ac_fn_check_decl "$LINENO" "I_PUSH" "ac_cv_have_decl_I_PUSH" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#include + #ifdef HAVE_SYS_TYPES_H + # include + #endif + #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_I_PUSH" = xyes then : + printf "%s\n" "#define HAVE_STROPTS_H 1" >>confdefs.h fi diff --git a/configure.ac b/configure.ac index 7a2d00b2c1dcdd..a7fca1fcdb949c 100644 --- a/configure.ac +++ b/configure.ac @@ -3022,11 +3022,13 @@ AC_HEADER_DIRENT AC_HEADER_MAJOR # On Linux, stropts.h may be empty -AC_CHECK_DECL([I_PUSH], [AC_DEFINE([HAVE_STROPTS_H], [1], [Define to 1 if you have the header file.])], [], [ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#include +AC_CHECK_DECL([I_PUSH], [ + AC_DEFINE([HAVE_STROPTS_H], [1], + [Define to 1 if you have the header file.])], [], [ + #ifdef HAVE_SYS_TYPES_H + # include + #endif + #include ]) # bluetooth/bluetooth.h has been known to not compile with -std=c99.