diff options
author | 7890 <tom@trellis.ch> | 2019-01-16 10:28:16 +0100 |
---|---|---|
committer | Filipe Coelho <falktx@falktx.com> | 2019-01-16 10:28:16 +0100 |
commit | 9fe56af980e4a7279cfe826a2b1f8bf1f799763a (patch) | |
tree | fb0b70c5135733f72c26cc21857f506c7f164df0 | |
parent | 04804290e2251039cd6e971ec3a34b81213dcd57 (diff) | |
download | jack2-9fe56af980e4a7279cfe826a2b1f8bf1f799763a.tar.gz |
Include inttypes.h. (#408)
When building with MXE, the macro expansion of PRIu64 fails:
../common/JackAPI.cpp: In function 'int jack_uuid_parse(const char*, jack_uuid_t*)':
../common/JackAPI.cpp:2119:24: error: expected ')' before 'PRIu64'
if (sscanf (b, "%" PRIu64, u) == 1) {
^
../common/JackAPI.cpp:2119:33: warning: spurious trailing '%' in format [-Wformat=]
if (sscanf (b, "%" PRIu64, u) == 1) {
^
../common/JackAPI.cpp:2119:33: warning: too many arguments for format [-Wformat-extra-args]
../common/JackAPI.cpp: In function 'void jack_uuid_unparse(jack_uuid_t, char*)':
../common/JackAPI.cpp:2134:45: error: expected ')' before 'PRIu64'
snprintf (b, JACK_UUID_STRING_SIZE, "%" PRIu64, u);
^
../common/JackAPI.cpp:2134:54: warning: spurious trailing '%' in format [-Wformat=]
snprintf (b, JACK_UUID_STRING_SIZE, "%" PRIu64, u);
^
../common/JackAPI.cpp:2134:54: warning: too many arguments for format [-Wformat-extra-args]
This could be resolved by adding those two lines:
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
References:
https://stackoverflow.com/questions/14535556/why-doesnt-priu64-work-in-this-code
https://stackoverflow.com/questions/8132399/how-to-printf-uint64-t-fails-with-spurious-trailing-in-format
-rw-r--r-- | common/JackAPI.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/JackAPI.cpp b/common/JackAPI.cpp index b4933508..b3d7c343 100644 --- a/common/JackAPI.cpp +++ b/common/JackAPI.cpp @@ -27,6 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "JackTime.h" #include "JackPortType.h" #include <math.h> +#define __STDC_FORMAT_MACROS 1 +#include <inttypes.h> using namespace Jack; |