diff --git a/data/win32/fldigi.nsi b/data/win32/fldigi.nsi index 9a98d25b..63c3fb26 100644 --- a/data/win32/fldigi.nsi +++ b/data/win32/fldigi.nsi @@ -121,7 +121,6 @@ SectionEnd SectionIn RO SetOutPath $INSTDIR File "${FLDIGI_BINARY}" - File /nonfatal "${MINGWM_DLL}" "${PTW32_DLL}" !ifdef FLDIGI_LOCALE_DIR File /r "${FLDIGI_LOCALE_PATH}/${FLDIGI_LOCALE_DIR}" !endif @@ -138,9 +137,6 @@ SectionEnd !endif SetOutPath $INSTDIR File "${FLARQ_BINARY}" -!ifndef HAVE_FLDIGI - File /nonfatal "${MINGWM_DLL}" "${PTW32_DLL}" -!endif StrCpy $WANT_FLARQ "true" SectionEnd !endif @@ -215,8 +211,6 @@ Section "Uninstall" !ifdef HAVE_FLARQ Delete /REBOOTOK $INSTDIR\${FLARQ_BINARY} !endif - Delete /REBOOTOK $INSTDIR\${MINGWM_DLL} - Delete /REBOOTOK $INSTDIR\${PTW32_DLL} Delete /REBOOTOK $INSTDIR\uninstall.exe # Remove shortcuts, if any diff --git a/scripts/mkhamlibstatic.sh b/scripts/mkhamlibstatic.sh index d4b105c6..81f2b89f 100755 --- a/scripts/mkhamlibstatic.sh +++ b/scripts/mkhamlibstatic.sh @@ -13,7 +13,7 @@ if test "x$PKG_CONFIG" != "x"; then else hamlib_dir="${HAMLIB_LIBS#*-L}" hamlib_dir="${HAMLIB_LIBS%% *}" - if test "x$hamlib_dir" = "x"; then + if test "x$hamlib_dir" = "x"; then\ hamlib_dir=/usr/lib fi fi diff --git a/scripts/mknsisinst.sh b/scripts/mknsisinst.sh index a3bea219..a36d6b16 100755 --- a/scripts/mknsisinst.sh +++ b/scripts/mknsisinst.sh @@ -35,6 +35,8 @@ fldigi_bin=fldigi.exe flarq_name=Flarq flarq_bin=flarq.exe +def= + if test "x$WANT_FLDIGI" != "xyes" && test "x$WANT_FLARQ" != "xyes"; then echo "E: refusing to create empty installer" >&2 exit 1 @@ -48,43 +50,6 @@ if test "x$WANT_FLARQ" = "xyes"; then def="$def -DHAVE_FLARQ -DFLARQ_NAME=$flarq_name -DFLARQ_BINARY=$flarq_bin -DFLARQ_VERSION=$FLARQ_VERSION" fi -# Look for pthreadGC2.dll and mingwm10.dll -MINGWM_DLL=mingwm10.dll -PTW32_DLL=pthreadGC2.dll -if ! test -r "$build/$MINGWM_DLL" || ! test -r "$build/$PTW32_DLL"; then - IFS_saved="$IFS" - IFS=: - MINGWM_PATH="" - PTW32_PATH="" - for dir in $LIB_PATH; do - test "x$MINGWM_PATH" = "x" && test -r "$dir/$MINGWM_DLL" && MINGWM_PATH="$dir/$MINGWM_DLL" - test "x$PTW32_PATH" = "x" && test -r "$dir/$PTW32_DLL" && PTW32_PATH="$dir/$PTW32_DLL" - done - IFS="$IFS_saved" -fi -if ! test -r "$build/$MINGWM_DLL"; then - if test "x$MINGWM_PATH" != "x"; then - cp "$MINGWM_PATH" "$build" - elif test -r /usr/share/doc/mingw32-runtime/${MINGWM_DLL}.gz; then - # Debian and Ubuntu - gzip -dc /usr/share/doc/mingw32-runtime/${MINGWM_DLL}.gz > "$build/$MINGWM_DLL" - fi -fi -if ! test -r "$build/$PTW32_DLL"; then - if test "x$PTW32_PATH" != "x"; then - cp "$PTW32_PATH" "$build" - else - # look for dll in PTW32_LIBS - dir=$(echo $PTW32_LIBS | sed -r 's/.*-L([[:graph:]]+).*/\1/g') - lib=$(echo $PTW32_LIBS | sed -r 's/.*-l(pthreadGC[[:graph:]]+).*/\1/g') - lib="${lib}.dll" - if test -r "$dir/$lib"; then - cp "$dir/$lib" "$build" - fi - fi -fi -def="$def -DMINGWM_DLL=$MINGWM_DLL -DPTW32_DLL=$PTW32_DLL" - if test "x$USE_NLS" = "xyes" && make -C "$srcdir/../po" install prefix="$build" >/dev/null; then def="$def -DFLDIGI_LOCALE_PATH=$build/share -DFLDIGI_LOCALE_DIR=locale" fi diff --git a/src/dialogs/fl_digi.cxx b/src/dialogs/fl_digi.cxx index b9537737..3cb8b521 100644 --- a/src/dialogs/fl_digi.cxx +++ b/src/dialogs/fl_digi.cxx @@ -91,6 +91,7 @@ #if USE_HAMLIB #include "hamlib.h" #endif +#include "timeops.h" #include "rigio.h" #include "rigMEM.h" #include "nullmodem.h" diff --git a/src/include/timeops.h b/src/include/timeops.h index d2d7603d..ee2588de 100644 --- a/src/include/timeops.h +++ b/src/include/timeops.h @@ -25,4 +25,9 @@ struct timeval& operator-=(struct timeval &t0, const struct timeval &t1); bool operator>(const struct timeval &t0, const struct timeval &t1); bool operator==(const struct timeval &t0, const struct timeval &t1); +#ifndef GMTIME_R +extern struct tm *gmtime_r(const time_t *timer, struct tm *tmbuf); +extern struct tm *localtime_r(const time_t *_Time,struct tm *_Tm); +#endif + #endif // TIMEOPS_H_ diff --git a/src/logbook/qso_db.cxx b/src/logbook/qso_db.cxx index 71a67b1c..20f0e8a6 100644 --- a/src/logbook/qso_db.cxx +++ b/src/logbook/qso_db.cxx @@ -30,6 +30,7 @@ #include "qso_db.h" #include "field_def.h" #include "globals.h" +#include "timeops.h" #include "pthread.h" diff --git a/src/logger/rx_extract.cxx b/src/logger/rx_extract.cxx index b9b8c883..e49ec66a 100644 --- a/src/logger/rx_extract.cxx +++ b/src/logger/rx_extract.cxx @@ -39,6 +39,7 @@ #include "debug.h" #include "icons.h" #include "qrunner.h" +#include "timeops.h" using namespace std; diff --git a/src/misc/debug.cxx b/src/misc/debug.cxx index 06b9287e..320fc3a8 100644 --- a/src/misc/debug.cxx +++ b/src/misc/debug.cxx @@ -48,6 +48,7 @@ #include #include "debug.h" +#include "timeops.h" #include "icons.h" #include "gettext.h" diff --git a/src/misc/log.cxx b/src/misc/log.cxx index b6a107fb..05cea96e 100644 --- a/src/misc/log.cxx +++ b/src/misc/log.cxx @@ -38,6 +38,7 @@ #include "log.h" #include "trx.h" #include "fl_digi.h" +#include "timeops.h" using namespace std; diff --git a/src/misc/macros.cxx b/src/misc/macros.cxx index 66e4009c..929d1344 100644 --- a/src/misc/macros.cxx +++ b/src/misc/macros.cxx @@ -33,6 +33,7 @@ #include "misc.h" #include "fl_digi.h" +#include "timeops.h" #include "configuration.h" #include "confdialog.h" #include "logger.h" @@ -1808,13 +1809,13 @@ void set_macro_env(void) // frequencies char dial_freq[20]; - snprintf(dial_freq, sizeof(dial_freq), "%lld", (long long)wf->rfcarrier()); + snprintf(dial_freq, sizeof(dial_freq), "%ld", (long)wf->rfcarrier()); env[FLDIGI_DIAL_FREQUENCY].val = dial_freq; char audio_freq[6]; snprintf(audio_freq, sizeof(audio_freq), "%d", active_modem->get_freq()); env[FLDIGI_AUDIO_FREQUENCY].val = audio_freq; char freq[20]; - snprintf(freq, sizeof(freq), "%lld", (long long)(wf->rfcarrier() + (wf->USB() + snprintf(freq, sizeof(freq), "%ld", (long)(wf->rfcarrier() + (wf->USB() ? active_modem->get_freq() : -active_modem->get_freq()))); env[FLDIGI_FREQUENCY].val = freq; diff --git a/src/misc/timeops.cxx b/src/misc/timeops.cxx index dda539ca..739dbc1a 100644 --- a/src/misc/timeops.cxx +++ b/src/misc/timeops.cxx @@ -173,3 +173,31 @@ bool operator==(const struct timeval &t0, const struct timeval &t1) { return t0.tv_sec == t1.tv_sec && t0.tv_usec == t1.tv_usec; } + + +#ifndef HAVE_GMTIME_R +#include "threads.h" + +static pthread_mutex_t gmtime_r_mutex = PTHREAD_MUTEX_INITIALIZER; + +struct tm *gmtime_r(const time_t *_Time, struct tm *_Tm) +{ + pthread_mutex_lock (&gmtime_r_mutex); + struct tm *p = gmtime(_Time); + if (p && _Tm) memcpy (_Tm, p, sizeof (struct tm)); + pthread_mutex_unlock (&gmtime_r_mutex); + return p; +} + +static pthread_mutex_t gmtime_local_mutex = PTHREAD_MUTEX_INITIALIZER; + +struct tm *localtime_r(const time_t *_Time,struct tm *_Tm) +{ + pthread_mutex_lock (&gmtime_local_mutex); + struct tm *p = localtime(_Time); + if (p && _Tm) memcpy (_Tm, p, sizeof (struct tm)); + pthread_mutex_unlock (&gmtime_local_mutex); + return p; +} + +#endif diff --git a/src/navtex/navtex.cxx b/src/navtex/navtex.cxx index 7e1548e3..fd2ce2d6 100644 --- a/src/navtex/navtex.cxx +++ b/src/navtex/navtex.cxx @@ -785,7 +785,7 @@ public: } // display }; // ccir_message -static const double deviation_f = 90.0; +static const int deviation_f = 90; static const double dflt_center_freq = 1000.0 ; diff --git a/src/spot/notify.cxx b/src/spot/notify.cxx index 03eb92b3..16396828 100644 --- a/src/spot/notify.cxx +++ b/src/spot/notify.cxx @@ -33,6 +33,8 @@ #include #include +#include "timeops.h" + #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) # define MAP_TYPE std::tr1::unordered_map # include diff --git a/src/wefax/wefax.cxx b/src/wefax/wefax.cxx index cab23384..30529289 100644 --- a/src/wefax/wefax.cxx +++ b/src/wefax/wefax.cxx @@ -45,6 +45,7 @@ #include "main.h" #include "misc.h" +#include "timeops.h" #include "fl_digi.h" #include "configuration.h" #include "status.h" diff --git a/src/widgets/FTextView.cxx b/src/widgets/FTextView.cxx index 54222b22..e38b9358 100644 --- a/src/widgets/FTextView.cxx +++ b/src/widgets/FTextView.cxx @@ -133,7 +133,7 @@ void FTextBase::add(const char *s, int attr) /// void FTextBase::add(unsigned char c, int attr) { - char s[] = { FTEXT_DEF + attr, '\0' }; + char s[] = { (char)(FTEXT_DEF + attr), '\0' }; sbuf->replace(insert_position(), insert_position() + 1, s); s[0] = c; diff --git a/src/widgets/picture.cxx b/src/widgets/picture.cxx index 75b116ac..2a4d8fe0 100644 --- a/src/widgets/picture.cxx +++ b/src/widgets/picture.cxx @@ -54,6 +54,7 @@ #include "fl_lock.h" #include "picture.h" #include "debug.h" +#include "timeops.h" using namespace std;