Skip to content

Commit

Permalink
More clang-related work and configure updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Jan 13, 2024
1 parent 786ab8a commit f97cdf0
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 35 deletions.
10 changes: 8 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/config.h.in
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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" */
Expand Down
32 changes: 19 additions & 13 deletions libseq66/include/seq66_platform_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ahlstromcj@gmail.com>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions libseq66/src/util/filefunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions m4/ax_have_qt_clang.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 19 additions & 15 deletions seq_portmidi/src/ptlinux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -57,11 +57,25 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/timeb.h>
#include <pthread.h>

#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
*/
Expand All @@ -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;

Expand All @@ -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);
Expand All @@ -121,8 +127,6 @@ Pt_ftime (struct timeb * tp)
tp->time = 0;
tp->millitm = 0;
}
tp->timezone = 0;
tp->dstflag = 0;
}

/**
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f97cdf0

Please sign in to comment.