From 9aade8de3f525ee2ea7199e624ff7e57e3e02508 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Thu, 3 Feb 2022 22:31:42 -0600 Subject: [PATCH] Add config.h to include/hamlib so HAVE_PTHREAD is available if needed https://github.com/Hamlib/Hamlib/issues/947 --- android/ltdl.c | 2 +- configure.ac | 2 +- include/Makefile.am | 4 ++-- include/hamlib/rig.h | 4 ++-- lib/asyncpipe.h | 4 +--- lib/gettimeofday.c | 2 +- lib/termios.c | 6 ++---- lib/usleep.c | 2 +- rigs/tuner/tuner.h | 4 +--- rigs/winradio/winradio.h | 4 +--- src/register.h | 2 +- src/rig.c | 5 +---- tests/memload.c | 4 +--- tests/memsave.c | 4 +--- 14 files changed, 17 insertions(+), 32 deletions(-) diff --git a/android/ltdl.c b/android/ltdl.c index 400696659..47c34042e 100644 --- a/android/ltdl.c +++ b/android/ltdl.c @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include diff --git a/configure.ac b/configure.ac index 259ae4a8f..548c2b7e7 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ AC_INIT([Hamlib],[4.5~git],[hamlib-developer@lists.sourceforge.net],[hamlib],[ht AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) -AC_CONFIG_HEADERS([include/config.h]) +AC_CONFIG_HEADERS([include/hamlib/config.h]) dnl Place build system provided programs in this directory. AC_CONFIG_AUX_DIR([build-aux]) diff --git a/include/Makefile.am b/include/Makefile.am index fddf48f66..273d0ce2e 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,6 +1,6 @@ -noinst_HEADERS = config.h bandplan.h num_stdio.h +noinst_HEADERS = bandplan.h num_stdio.h nobase_include_HEADERS = hamlib/rig.h hamlib/riglist.h hamlib/rig_dll.h \ hamlib/rotator.h hamlib/rotlist.h hamlib/rigclass.h \ hamlib/rotclass.h hamlib/amplifier.h hamlib/amplist.h \ - hamlib/ampclass.h + hamlib/ampclass.h hamlib/config.h diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index cac81d083..56d9cf485 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -36,7 +36,7 @@ #include #include #ifdef HAVE_CONFIG_H -#include "config.h" +#include "hamlib/config.h" #endif #ifdef HAVE_PTHREAD #include @@ -2555,7 +2555,7 @@ struct rig_state { hamlib_port_t rigport; /*!< Rig port (internal use). */ hamlib_port_t pttport; /*!< PTT port (internal use). */ hamlib_port_t dcdport; /*!< DCD port (internal use). */ -#ifdef _PTHREAD_H +#ifdef HAVE_PTHREAD pthread_mutex_t mutex_set_transaction; #endif /********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/ diff --git a/lib/asyncpipe.h b/lib/asyncpipe.h index f9af2af0c..5919ef750 100644 --- a/lib/asyncpipe.h +++ b/lib/asyncpipe.h @@ -1,9 +1,7 @@ #ifndef _ASYNC_PIPE_H #define _ASYNC_PIPE_H 1 -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "hamlib/config.h" #if defined(WIN32) && defined(HAVE_WINDOWS_H) diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index b54ee3121..0d2fad152 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -1,5 +1,5 @@ -#include +#include #ifdef HAVE_WINDOWS_H #include diff --git a/lib/termios.c b/lib/termios.c index 02d0df323..0739cce9f 100644 --- a/lib/termios.c +++ b/lib/termios.c @@ -1,7 +1,5 @@ -#ifdef HAVE_CONFIG_H -#include "hamlib/rig.h" -#include -#endif +#include +#include #if defined(WIN32) && !defined(HAVE_TERMIOS_H) diff --git a/lib/usleep.c b/lib/usleep.c index 4631f25e7..70ad2d3f8 100644 --- a/lib/usleep.c +++ b/lib/usleep.c @@ -16,7 +16,7 @@ This file is part of the GNU C Library. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #ifndef HAVE_USLEEP diff --git a/rigs/tuner/tuner.h b/rigs/tuner/tuner.h index 4f835087a..883bd4c77 100644 --- a/rigs/tuner/tuner.h +++ b/rigs/tuner/tuner.h @@ -22,9 +22,7 @@ #ifndef _TUNER_H #define _TUNER_H 1 -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "hamlib/config.h" /* * So far, only Linux has Video4Linux support through ioctl :) * until someone port it to some other OS... diff --git a/rigs/winradio/winradio.h b/rigs/winradio/winradio.h index 707eba79f..1f6766b6d 100644 --- a/rigs/winradio/winradio.h +++ b/rigs/winradio/winradio.h @@ -22,9 +22,7 @@ #ifndef _WINRADIO_H #define _WINRADIO_H 1 -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "hamlib/config.h" #define BACKEND_VER "20110822" /* diff --git a/src/register.h b/src/register.h index 7407ffc8a..c68b51102 100644 --- a/src/register.h +++ b/src/register.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #ifdef __cplusplus #define EXTERN_C extern "C" diff --git a/src/rig.c b/src/rig.c index a57cd353b..4157bc17d 100644 --- a/src/rig.c +++ b/src/rig.c @@ -50,9 +50,7 @@ */ #include "hamlib/rig.h" -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "hamlib/config.h" #include #include @@ -2626,7 +2624,6 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) ELAPSED1; ENTERFUNC; - rig_debug(RIG_DEBUG_ERR, "%s: rig->state.pttport.type.ptt=%d, %p\n", __func__, rig->state.pttport.type.ptt, &rig->state.pttport.type.ptt); if (CHECK_RIG_ARG(rig)) { diff --git a/tests/memload.c b/tests/memload.c index 4c0ed946c..4a890f08e 100644 --- a/tests/memload.c +++ b/tests/memload.c @@ -19,9 +19,7 @@ */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include #include diff --git a/tests/memsave.c b/tests/memsave.c index 0e732e14d..a01d4031d 100644 --- a/tests/memsave.c +++ b/tests/memsave.c @@ -18,9 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include #include