-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using {fmt} on IBM i (AS/400) 7.3 ILE C++ compiler #1059
Comments
{fmt} version 5.x requires a subset of C++11 including |
I downloaded version 4.x and defined the macro FMT_HEADER_ONLY. Note: Can intptr_t be replaced by another type, e.g. unsigned int ? I've replaced this type as follows: void write_pointer(const void *p) {
spec_.flags_ = HASH_FLAG;
spec_.type_ = 'x';
//writer_.write_int(reinterpret_cast<uintptr_t>(p), spec_);
writer_.write_int(reinterpret_cast<unsigned int>(p), spec_);
} and my test programm works. |
AFAIK the integral type should be large enough for the cast to be valid. A better option is to have a struct of two 64-bit integers, bitcast the pointer to it and then write those two integers. |
or use non-standard 128-bit integral type if available. |
128-bit integral type isn't available but i have uint64_t in stdint.h what if i typedef here something like this: #ifdef __UINTPTR_T_AS400
typedef uint64_t uintptr_t
#endif ? |
Sure if you are OK with the cast being not particularly kosher. |
OK, what if you change reinterpret_cast to uintptr_t for the pointer to another cast ? e.g. inside write_int method you cast T value to UnsignedType. writer_.write_int(reinterpret_cast<uintptr_t>(p), spec_); to typedef typename internal::IntTraits<T>::MainType UnsignedType;
writer_.write_int(reinterpret_cast<UnsignedType>(p), spec_); ? |
This will have the same issue. As I wrote earlier:
|
bd81771 adds support for platforms without |
I added the include/fmt folder to my project
when I include fmt/printf.h in the program, the IBM i 7.3 ILE C++ compiler,
which doesn't fully implement C++11,
I get the following errors:
../fmt/core.h(481) : error : at column 021 - The name "typename std::enable_if" is not a type.
../fmt/core.h(196) : error : at column 001 - The name "typename std::add_rvalue_reference" is not a type.
../fmt/core.h(210) : error : at column 015 - The name "typename std::make_unsigned" is not a type.
../fmt/core.h(662) : error : at column 025 - The text "<" is unexpected. "std::conditional" may be undeclared or ambiguous.
../fmt/core.h(665) : error : at column 070 - The name lookup for "long_type" did not find a declaration.
../fmt/core.h(665) : warning : at column 070 - Declarations for non-dependent names are resolved in the template definition.
../fmt/core.h(665) : warning : at column 070 - "long_type" does not depend on a template argument.
../fmt/core.h(670) : error : at column 020 - The name lookup for "ulong_type" did not find a declaration.
../fmt/core.h(670) : warning : at column 020 - "ulong_type" does not depend on a template argument.
../fmt/core.h(874) : error : at column 027 - "std::forward" is not declared.
../fmt/format.h(597) : error : at column 003 - The template argument must be a type, to match the template parameter.
../fmt/format.h(672) : error : at column 048 - The name "typename std::is_void" is not a type.
../fmt/format.h(677) : error : at column 026 - The text "<" is unexpected.
../fmt/format.h(999) : error : at column 010 - "internal::copy_str" is not declared.
../fmt/format.h(1661) : error : at column 019 - The name lookup for "to_unsigned" did not find a declaration.
../fmt/format.h(1661) : warning : at column 019 - "to_unsigned" does not depend on a template argument.
../fmt/format.h(2019) : error : at column 010 - The text "{" is unexpected.
../fmt/format.h(2900) : error : at column 007 - "internal::is_negative" is not declared.
../fmt/format.h(3258) : error : at column 003 - "internal::check_format_string" is not declared.
../fmt/format.h(398) : error : at column 034 - "internal::to_unsigned" is not declared.
../fmt/ostream.h(78) : error : at column 029 - The text "<" is unexpected. "std::make_unsigned" may be undeclared, ambiguous, or may require "typename" qualification.
The text was updated successfully, but these errors were encountered: