-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace kstream::to_string() - not just
int
, fix portability
See #8 (comment) Fix #28, close #39
- Loading branch information
1 parent
aaa2a3f
commit 5ee4e19
Showing
5 changed files
with
85 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef KAITAI_DETAIL_MAKE_UNSIGNED_H | ||
#define KAITAI_DETAIL_MAKE_UNSIGNED_H | ||
|
||
namespace kaitai { | ||
// poor man's implementation of `std::make_unsigned` in pre-C++11 versions | ||
// (https://stackoverflow.com/a/27577556) | ||
// | ||
// Don't use this externally. This is an internal implementation helper | ||
// and may be removed at any time. | ||
template<typename T> struct make_unsigned { typedef T type; }; | ||
template<> struct make_unsigned<char> { typedef unsigned char type; }; | ||
template<> struct make_unsigned<signed char> { typedef unsigned char type; }; | ||
template<> struct make_unsigned<short> { typedef unsigned short type; }; | ||
template<> struct make_unsigned<int> { typedef unsigned int type; }; | ||
template<> struct make_unsigned<long> { typedef unsigned long type; }; | ||
// `long long` is available only since C++11 | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters