Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -39,42 +39,12 @@ AC_DEFINE(LLONG_MAX, 0x7FFFFFFFFFFFFFFFLL, [Maximum value for long long]) AC_DEFINE(LLONG_MIN, [(-0x7FFFFFFFFFFFFFFFLL - 1)], [Minimum value for long long]) - AC_DEFINE(PRId8, "hhd", [Format string for 8-bit as decimal]) - AC_DEFINE(PRId16, "hd", [Format string for 16-bit as decimal]) - AC_DEFINE(PRId32, "d", [Format string for 32-bit as decimal]) - AC_DEFINE(PRId64, "lld", [Format string for 64-bit as decimal]) - AC_DEFINE(PRIi8, "hhi", [Format string for 8-bit as integer]) - AC_DEFINE(PRIi16, "hi", [Format string for 16-bit as integer]) - AC_DEFINE(PRIi32, "i", [Format string for 32-bit as integer]) - AC_DEFINE(PRIi64, "lli", [Format string for 64-bit as integer]) - AC_DEFINE(PRIo8, "hho", [Format string for 8-bit as octal]) - AC_DEFINE(PRIo16, "ho", [Format string for 16-bit as octal]) - AC_DEFINE(PRIo32, "o", [Format string for 32-bit as octal]) - AC_DEFINE(PRIo64, "llo", [Format string for 64-bit as octal]) - AC_DEFINE(PRIu8, "hhu", [Format string for 8-bit as unsigned]) - AC_DEFINE(PRIu16, "hu", [Format string for 16-bit as unsigned]) - AC_DEFINE(PRIu32, "u", [Format string for 32-bit as unsigned]) - AC_DEFINE(PRIu64, "llu", [Format string for 64-bit as unsigned]) - AC_DEFINE(PRIx8, "hhx", - [Format string for 8-bit as lowercase hex]) - AC_DEFINE(PRIx16, "hx", - [Format string for 16-bit as lowercase hex]) - AC_DEFINE(PRIx32, "x", - [Format string for 32-bit as lowercase hex]) - AC_DEFINE(PRIx64, "llx", - [Format string for 64-bit as lowercase hex]) - AC_DEFINE(PRIX8, "hhX", - [Format string for 8-bit as uppercase hex]) - AC_DEFINE(PRIX16, "hX", - [Format string for 16-bit as uppercase hex]) - AC_DEFINE(PRIX32, "X", - [Format string for 32-bit as uppercase hex]) - AC_DEFINE(PRIX64, "llX", - [Format string for 64-bit as uppercase hex]) + AC_DEFINE(__have_longlong64, 1, + [Required for AmigaOS to correctly define PRI?64]) AC_SUBST(NOIXEMUL, -noixemul) ;; powerpc-*-amigaos*) enable_shared="no" Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -2504,11 +2504,11 @@ - (float)floatValue { void *pool = objc_autoreleasePoolPush(); -#ifdef OF_MORPHOS +#if defined(OF_AMIGAOS3) || defined(OF_MORPHOS) OFString *stripped = [self stringByDeletingEnclosingWhitespaces]; if ([stripped caseInsensitiveCompare: @"INF"] == OF_ORDERED_SAME || [stripped caseInsensitiveCompare: @"INFINITY"] == OF_ORDERED_SAME) return INFINITY; @@ -2554,11 +2554,11 @@ - (double)doubleValue { void *pool = objc_autoreleasePoolPush(); -#ifdef OF_MORPHOS +#if defined(OF_AMIGAOS3) || defined(OF_MORPHOS) OFString *stripped = [self stringByDeletingEnclosingWhitespaces]; if ([stripped caseInsensitiveCompare: @"INF"] == OF_ORDERED_SAME || [stripped caseInsensitiveCompare: @"INFINITY"] == OF_ORDERED_SAME) return INFINITY; Index: src/OFSystemInfo.m ================================================================== --- src/OFSystemInfo.m +++ src/OFSystemInfo.m @@ -111,10 +111,12 @@ operatingSystemName = @"macOS"; #elif defined(OF_WINDOWS) operatingSystemName = @"Windows"; #elif defined(OF_ANDROID) operatingSystemName = @"Android"; +#elif defined(OF_AMIGAOS3) + operatingSystemName = @"AmigaOS"; #elif defined(OF_MORPHOS) operatingSystemName = @"MorphOS"; #elif defined(OF_AMIGAOS4) operatingSystemName = @"AmigaOS 4"; #elif defined(OF_WII) Index: src/objfw-defs.h.in ================================================================== --- src/objfw-defs.h.in +++ src/objfw-defs.h.in @@ -39,32 +39,9 @@ #undef OF_HAVE__THREAD_LOCAL #undef OF_HAVE___THREAD #undef OF_NINTENDO_DS #undef OF_OBJFW_RUNTIME #undef OF_UNIVERSAL -#undef PRId8 -#undef PRId16 -#undef PRId32 -#undef PRId64 -#undef PRIi8 -#undef PRIi16 -#undef PRIi32 -#undef PRIi64 -#undef PRIo8 -#undef PRIo16 -#undef PRIo32 -#undef PRIo64 -#undef PRIu8 -#undef PRIu16 -#undef PRIu32 -#undef PRIu64 -#undef PRIx8 -#undef PRIx16 -#undef PRIx32 -#undef PRIx64 -#undef PRIX8 -#undef PRIX16 -#undef PRIX32 -#undef PRIX64 #undef SIZE_MAX #undef UINTPTR_MAX #undef ULLONG_MAX +#undef __have_longlong64 Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -876,24 +876,28 @@ * These test numbers can be generated without rounding if we have IEEE * floating point numbers, thus we can use == on them. */ TEST(@"-[floatValue]", [C(@"\t-0.25 ") floatValue] == -0.25 && - [C(@"\r\n\tINF\t\n") doubleValue] == INFINITY && + [C(@"\r\n\tINF\t\n") floatValue] == INFINITY && [C(@"\r -INFINITY\n") floatValue] == -INFINITY && isnan([C(@" NAN\t\t") floatValue])) -#if !defined(OF_ANDROID) && !defined(OF_SOLARIS) && !defined(OF_DJGPP) +#if !defined(OF_ANDROID) && !defined(OF_SOLARIS) && !defined(OF_DJGPP) && \ + !defined(OF_AMIGAOS3) # define INPUT @"\t-0x1.FFFFFFFFFFFFFP-1020 " # define EXPECTED -0x1.FFFFFFFFFFFFFP-1020 #else -/* Android, Solaris and DJGPP do not accept 0x for strtod() */ -# if !defined(OF_SOLARIS) || !defined(OF_X86) +/* Android, Solaris, DJGPP and AmigaOS3 do not accept 0x for strtod() */ +# if (!defined(OF_SOLARIS) || !defined(OF_X86)) && !defined(OF_AMIGAOS3) # define INPUT @"\t-0.123456789 " # define EXPECTED -0.123456789 # else -/* Solaris' strtod() has weird rounding on x86, but not on x86_64 */ +/* + * Solaris' strtod() has weird rounding on x86, but not on x86_64/ + * AmigaOS 3 with libnix has weird rounding as well. + */ # define INPUT @"\t-0.125 " # define EXPECTED -0.125 # endif #endif TEST(@"-[doubleValue]",