diff --git a/configure.ac b/configure.ac index db4e4a421..ad3b9805c 100644 --- a/configure.ac +++ b/configure.ac @@ -449,6 +449,8 @@ AC_LINK_IFELSE( ) AC_CHECK_FUNCS([pthread_yield pthread_setname_np]) +AC_CHECK_DECLS([optreset], [], [], [[#include ]]) + AC_ARG_ENABLE(docs, AS_HELP_STRING([--enable-docs],[enable generation of documentation]), [ENABLE_DOCS=${enableval}], [ENABLE_DOCS=no]) diff --git a/src/librtpp_main.c b/src/librtpp_main.c index 8cf096272..1ae306d2e 100644 --- a/src/librtpp_main.c +++ b/src/librtpp_main.c @@ -27,6 +27,8 @@ #include +#include "config.h" + #include "librtpproxy.h" #include "librtpp_main.h" @@ -38,8 +40,8 @@ struct opt_save { int optreset; }; -#if defined(__linux__) -static int optreset; /* Not present in linux */ +#if !HAVE_DECL_OPTRESET +static int optreset; /* Not present in glibc */ #endif #define OPT_SAVE(sp) (*(sp) = (struct opt_save){optarg, optind, optopt, opterr, optreset})