From 076258cc458f1e705041ac7a729b15ffe8c5214a Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Thu, 9 Oct 2014 19:41:51 +0300 Subject: [PATCH] Add support for AmigaOS/AROS to tuklib_physmem(). Thanks to Fredrik Wikstrom. --- m4/tuklib_physmem.m4 | 3 ++- src/common/tuklib_physmem.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/m4/tuklib_physmem.m4 b/m4/tuklib_physmem.m4 index 12499256..ea02208f 100644 --- a/m4/tuklib_physmem.m4 +++ b/m4/tuklib_physmem.m4 @@ -53,7 +53,8 @@ AC_CACHE_CHECK([how to detect the amount of physical memory], # a non-compilable text instead of #error to generate an error. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \ - || defined(__DJGPP__) || defined(__VMS) + || defined(__DJGPP__) || defined(__VMS) \ + || defined(AMIGA) || defined(__AROS__) int main(void) { return 0; } #else compile error diff --git a/src/common/tuklib_physmem.c b/src/common/tuklib_physmem.c index 623b6e70..3cc7d12a 100644 --- a/src/common/tuklib_physmem.c +++ b/src/common/tuklib_physmem.c @@ -33,6 +33,10 @@ # include # include +#elif defined(AMIGA) || defined(__AROS__) +# define __USE_INLINE__ +# include + // AIX #elif defined(TUKLIB_PHYSMEM_AIX) # include @@ -119,6 +123,9 @@ tuklib_physmem(void) if (LIB$GETSYI(&val, &vms_mem, 0, 0, 0, 0) == SS$_NORMAL) ret = (uint64_t)vms_mem * 8192; +#elif defined(AMIGA) || defined(__AROS__) + ret = AvailMem(MEMF_TOTAL); + #elif defined(TUKLIB_PHYSMEM_AIX) ret = _system_configuration.physmem;