diff --git a/makefile b/makefile index 202a3377..c358caba 100644 --- a/makefile +++ b/makefile @@ -171,7 +171,9 @@ c89: -e 's/INT64_MAX/(mp_i64)(((mp_u64)1<<63)-1)/g' \ -e 's/INT64_MIN/(mp_i64)((mp_u64)1<<63)/g' \ -e 's/SIZE_MAX/((size_t)-1)/g' \ - -e 's/\(PRI[iux]64\)/MP_\1/g' \ + -e 's/\([^u]\)intmax_t/\1__intmax_t/g' \ + -e 's/uintmax_t/__uintmax_t/g' \ + -e 's/\(PRI[ioux]64\)/MP_\1/g' \ -e 's/uint\([0-9][0-9]*\)_t/mp_u\1/g' \ -e 's/int\([0-9][0-9]*\)_t/mp_i\1/g' \ -e 's/__func__/MP_FUNCTION_NAME/g' \ @@ -195,7 +197,9 @@ c99: -e 's/(mp_i64)((mp_u64)1<<63)/INT64_MIN/g' \ -e 's/(mp_i64)(((mp_u64)1<<63)-1)/INT64_MAX/g' \ -e 's/((size_t)-1)/SIZE_MAX/g' \ - -e 's/MP_\(PRI[iux]64\)/\1/g' \ + -e 's/__intmax_t/intmax_t/g' \ + -e 's/__uintmax_t/uintmax_t/g' \ + -e 's/MP_\(PRI[iuox]64\)/\1/g' \ -e 's/mp_u\([0-9][0-9]*\)/uint\1_t/g' \ -e 's/mp_i\([0-9][0-9]*\)/int\1_t/g' \ -e 's/MP_FUNCTION_NAME/__func__/g' \ diff --git a/s_mp_fprintf.c b/s_mp_fprintf.c index 227d832c..d1855575 100644 --- a/s_mp_fprintf.c +++ b/s_mp_fprintf.c @@ -165,8 +165,8 @@ static int s_mp_print_limb(const mp_digit d, const char *format, int base, bool #elif defined(MP_64BIT) switch (base) { case 8: -/* -its defined in the local inttype.h as + /* + its defined in the local inttype.h as # if __WORDSIZE == 64 # define __PRI64_PREFIX "l" # define __PRIPTR_PREFIX "l" @@ -175,11 +175,11 @@ its defined in the local inttype.h as # define __PRIPTR_PREFIX # endif - ... + ... # define PRIo64 __PRI64_PREFIX "o" -*/ + */ f = strcat(f, PRIo64); break; case 10: @@ -362,7 +362,7 @@ int s_mp_fprintf(FILE *stream, const char *format, va_list args) } break; case 'j': - printed_characters += fprintf(stream, format_out, va_arg(args, intmax_t)); + printed_characters += fprintf(stream, format_out, va_arg(args,intmax_t)); break; case 't': printed_characters += fprintf(stream, format_out, va_arg(args, ptrdiff_t)); diff --git a/tommath_c89.h b/tommath_c89.h index e7b87f10..49400a13 100644 --- a/tommath_c89.h +++ b/tommath_c89.h @@ -36,5 +36,6 @@ typedef __UINT64_TYPE__ mp_u64; #define MP_PRIi64 MP_PRI64_PREFIX "i" #define MP_PRIu64 MP_PRI64_PREFIX "u" #define MP_PRIx64 MP_PRI64_PREFIX "x" +#define MP_PRIo64 MP_PRI64_PREFIX "o" #define MP_FUNCTION_NAME __func__