Skip to content

Commit

Permalink
Define __STDC_FORMAT_MACROS before includine cinttypes for (see #61).
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Westerfeld <[email protected]>
  • Loading branch information
swesterfeld committed Jun 8, 2024
1 parent 4b06925 commit b73adb9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/mpegts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <array>
#include <regex>

#include <inttypes.h>
#include <string.h>
#include "utils.hh"
#include "mpegts.hh"
Expand Down
1 change: 0 additions & 1 deletion src/random.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <regex>

#include <assert.h>
#include <cinttypes>

using std::string;
using std::vector;
Expand Down
2 changes: 0 additions & 2 deletions src/testrandom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include "utils.hh"
#include "random.hh"

#include <inttypes.h>

using std::vector;
using std::string;

Expand Down
6 changes: 6 additions & 0 deletions src/utils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#include <vector>
#include <string>

#ifndef __STDC_FORMAT_MACROS
// some compilers/platforms (i.e. very old macOS) need this for macros like PRId64 (#61)
#define __STDC_FORMAT_MACROS
#endif
#include <cinttypes>

std::vector<int> bit_str_to_vec (const std::string& bits);
std::string bit_vec_to_str (const std::vector<int>& bit_vec);

Expand Down

0 comments on commit b73adb9

Please sign in to comment.