Skip to content

Commit b73adb9

Browse files
committed
Define __STDC_FORMAT_MACROS before includine cinttypes for (see #61).
Signed-off-by: Stefan Westerfeld <[email protected]>
1 parent 4b06925 commit b73adb9

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Diff for: src/mpegts.cc

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <array>
1919
#include <regex>
2020

21-
#include <inttypes.h>
2221
#include <string.h>
2322
#include "utils.hh"
2423
#include "mpegts.hh"

Diff for: src/random.cc

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <regex>
2222

2323
#include <assert.h>
24-
#include <cinttypes>
2524

2625
using std::string;
2726
using std::vector;

Diff for: src/testrandom.cc

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "utils.hh"
1919
#include "random.hh"
2020

21-
#include <inttypes.h>
22-
2321
using std::vector;
2422
using std::string;
2523

Diff for: src/utils.hh

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
#include <vector>
2222
#include <string>
2323

24+
#ifndef __STDC_FORMAT_MACROS
25+
// some compilers/platforms (i.e. very old macOS) need this for macros like PRId64 (#61)
26+
#define __STDC_FORMAT_MACROS
27+
#endif
28+
#include <cinttypes>
29+
2430
std::vector<int> bit_str_to_vec (const std::string& bits);
2531
std::string bit_vec_to_str (const std::vector<int>& bit_vec);
2632

0 commit comments

Comments
 (0)