From f97cdf08d0aa35008c8be26c3f1a70d3ef96c17c Mon Sep 17 00:00:00 2001 From: Chris Ahlstrom Date: Sat, 13 Jan 2024 10:27:52 -0500 Subject: [PATCH] More clang-related work and configure updates. --- configure | 10 +++++-- configure.ac | 4 ++- include/config.h.in | 4 +-- libseq66/include/seq66_platform_macros.h | 32 +++++++++++++--------- libseq66/src/util/filefunctions.cpp | 8 ++++-- m4/ax_have_qt_clang.m4 | 1 + seq_portmidi/src/ptlinux.c | 34 +++++++++++++----------- 7 files changed, 58 insertions(+), 35 deletions(-) diff --git a/configure b/configure index d16eb57b..6b3e2e88 100755 --- a/configure +++ b/configure @@ -4804,11 +4804,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF + + cat >>confdefs.h <<_ACEOF -#define APP_BUILD_ISSUE "Ubuntu 20.04.6 LTS" +#define APP_BUILD_ISSUE "GNU/Linux" _ACEOF + $as_echo "#define CLIENT_NAME \"seq66\"" >>confdefs.h @@ -16105,7 +16108,9 @@ seq66pixdir="${datadir}/pixmaps/seq66-${SEQ66_API_VERSION}" -CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} -I/usr/local/include " +CXXFLAGS="${CXXFLAGS} -I/usr/local/include " +LDFLAGS="${LDFLAGS} -L/usr/local/lib " for ac_header in getopt.h string.h limits.h @@ -19409,6 +19414,7 @@ percent.commands = @echo -n "\$(\$(@))\ " QMAKE_EXTRA_TARGETS += percent EOF $am_have_qt_qmexe $am_have_qt_pro -o $am_have_qt_makefile + echo "QT TEST Makefile = $am_have_qt_makefile" # Get Qt version from qmake diff --git a/configure.ac b/configure.ac index 627207a2..bdeea33d 100644 --- a/configure.ac +++ b/configure.ac @@ -235,7 +235,9 @@ AC_SUBST(seq66pixdir) dnl 4. Get external flags, if any. -CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} -I/usr/local/include " +CXXFLAGS="${CXXFLAGS} -I/usr/local/include " +LDFLAGS="${LDFLAGS} -L/usr/local/lib " dnl Check for header files. Added more to support daemonization. dnl diff --git a/include/config.h.in b/include/config.h.in index 4914cefa..a2a3f86e 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1,6 +1,6 @@ /* include/config.h.in. Generated from configure.ac by autoheader. */ -#define VERSION_DATE_SHORT "2023-12-29" +#define VERSION_DATE_SHORT "2024-01-13" #define API_VERSION "0.99" #define VERSION "0.99.12" @@ -9,7 +9,7 @@ /* Seq66 API version */ #undef API_VERSION -/* "Distro of build" */ +/* "Operating system of build" */ #undef APP_BUILD_ISSUE /* "OS/kernel where build was done" */ diff --git a/libseq66/include/seq66_platform_macros.h b/libseq66/include/seq66_platform_macros.h index 1d019a4d..dc4f3d9d 100644 --- a/libseq66/include/seq66_platform_macros.h +++ b/libseq66/include/seq66_platform_macros.h @@ -29,7 +29,7 @@ * \library seq66 application * \author Chris Ahlstrom * \date 2015-07-24 - * \updates 2023-12-18 + * \updates 2024-01-13 * \license GNU GPLv2 or above * * Copyright (C) 2013-2023 Chris Ahlstrom @@ -101,24 +101,25 @@ */ #undef SEQ66_MING_OR_WINDOWS -#undef SEQ66_PLATFORM_WINDOWS -#undef SEQ66_PLATFORM_LINUX -#undef SEQ66_PLATFORM_FREEBSD -#undef SEQ66_PLATFORM_MACOSX -#undef SEQ66_PLATFORM_UNIX #undef SEQ66_PLATFORM_32_BIT #undef SEQ66_PLATFORM_64_BIT +#undef SEQ66_PLATFORM_CLANG +#undef SEQ66_PLATFORM_CPP_11 +#undef SEQ66_PLATFORM_CPP_14 +#undef SEQ66_PLATFORM_CPP_17 +#undef SEQ66_PLATFORM_CYGWIN #undef SEQ66_PLATFORM_DEBUG -#undef SEQ66_PLATFORM_RELEASE -#undef SEQ66_PLATFORM_MSVC +#undef SEQ66_PLATFORM_FREEBSD #undef SEQ66_PLATFORM_GNU -#undef SEQ66_PLATFORM_XSI +#undef SEQ66_PLATFORM_LINUX +#undef SEQ66_PLATFORM_MACOSX #undef SEQ66_PLATFORM_MINGW -#undef SEQ66_PLATFORM_CYGWIN +#undef SEQ66_PLATFORM_MSVC #undef SEQ66_PLATFORM_POSIX_API -#undef SEQ66_PLATFORM_CPP_11 -#undef SEQ66_PLATFORM_CPP_14 -#undef SEQ66_PLATFORM_CPP_17 +#undef SEQ66_PLATFORM_RELEASE +#undef SEQ66_PLATFORM_UNIX +#undef SEQ66_PLATFORM_WINDOWS +#undef SEQ66_PLATFORM_XSI /** * Provides a "Windows" macro, in case the environment doesn't provide @@ -277,12 +278,17 @@ * Provides macros that indicate if Microsoft C/C++ versus GNU are being * used. THe compiler being used normally provides test macros for itself. * + * - SEQ66_PLATFORM_CLANG (replaces clang) * - SEQ66_PLATFORM_MSVC (replaces _MSC_VER) * - SEQ66_PLATFORM_GNU (replaces __GNUC__) * - SEQ66_PLATFORM_MINGW (replaces __MINGW32__) * - SEQ66_PLATFORM_CYGWIN */ +#if defined __clang__ +#define SEQ66_PLATFORM_CLANG +#endif + #if defined _MSC_VER #define SEQ66_PLATFORM_MSVC #define SEQ66_PLATFORM_WINDOWS diff --git a/libseq66/src/util/filefunctions.cpp b/libseq66/src/util/filefunctions.cpp index 539f3c1b..db5a6f99 100644 --- a/libseq66/src/util/filefunctions.cpp +++ b/libseq66/src/util/filefunctions.cpp @@ -25,7 +25,7 @@ * \library seq66 application * \author Chris Ahlstrom * \date 2015-11-20 - * \updates 2023-11-30 + * \updates 2024-01-13 * \version $Revision$ * * We basically include only the functions we need for Seq66, not @@ -1199,7 +1199,11 @@ make_directory (const std::string & pathname) { static struct stat st = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* and more for Linux! */ +#if defined SEQ66_PLATFORM_CLANG + 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0, 0 } /* Clang/FreeBSD */ +#else + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* and more for Linux! */ +#endif }; if (S_STAT(pathname.c_str(), &st) == -1) { diff --git a/m4/ax_have_qt_clang.m4 b/m4/ax_have_qt_clang.m4 index 43d2c683..fe2fcb04 100644 --- a/m4/ax_have_qt_clang.m4 +++ b/m4/ax_have_qt_clang.m4 @@ -59,6 +59,7 @@ percent.commands = @echo -n "\$(\$(@))\ " QMAKE_EXTRA_TARGETS += percent EOF $am_have_qt_qmexe $am_have_qt_pro -o $am_have_qt_makefile + echo "QT TEST Makefile = $am_have_qt_makefile" # Get Qt version from qmake diff --git a/seq_portmidi/src/ptlinux.c b/seq_portmidi/src/ptlinux.c index 67b6117d..a7c81672 100644 --- a/seq_portmidi/src/ptlinux.c +++ b/seq_portmidi/src/ptlinux.c @@ -24,7 +24,7 @@ * \library seq66 application * \author PortMIDI team; modifications by Chris Ahlstrom * \date 2017-08-21 - * \updates 2024-01-05 + * \updates 2024-01-13 * \license GNU GPLv2 or above * * Implementation Notes (by Mark Nelson): @@ -57,11 +57,25 @@ #include #include #include -#include #include #include "porttime.h" +/* + * The ftime(2) system call structure -- deprecated. But since it is used + * only internally in the module to transfer parts of the time, we define + * a partial replacement here. The following from timeb are not needed: + * + * short timezone; // minutes west of CUT + * short dstflag; // DST == non-zero + */ + +struct timeb_simple +{ + time_t time; /* seconds since the Epoch */ + unsigned short millitm; /* + milliseconds since the Epoch */ +}; + /* * REDUNDANT */ @@ -70,7 +84,7 @@ #define FALSE 0 static int time_started_flag = FALSE; -static struct timeb time_offset = { 0, 0, 0, 0 }; +static struct timeb_simple time_offset = { 0, 0 }; static pthread_t pt_thread_pid; static int pt_thread_created = FALSE; @@ -96,18 +110,10 @@ static int pt_callback_proc_id = 0; /** * The ftime() function, which returns he current tim in seconds and * milliseconds since the Epoch, is deprecated in favor or clock_gettime(2). - * - * struct timeb time_offset = - * { - * 0, // time - * 0, // millitm - * 0, // timezone - * 0 // dstflag - * }; */ void -Pt_ftime (struct timeb * tp) +Pt_ftime (struct timeb_simple * tp) { struct timespec temptime; int rc = clock_gettime(CLOCK_REALTIME_COARSE, &temptime); @@ -121,8 +127,6 @@ Pt_ftime (struct timeb * tp) tp->time = 0; tp->millitm = 0; } - tp->timezone = 0; - tp->dstflag = 0; } /** @@ -217,7 +221,7 @@ PtTimestamp Pt_Time (void) { long seconds, milliseconds; - struct timeb now; + struct timeb_simple now; Pt_ftime(&now); // ftime(&now); seconds = now.time - time_offset.time; milliseconds = now.millitm - time_offset.millitm;