[Vm-dev] [commit][3653]
add SQABS and SQLABS macros for taking absolute values of sqInt and sqLong
commits at squeakvm.org
commits at squeakvm.org
Sat Mar 26 22:24:46 UTC 2016
Revision: 3653
Author: nice
Date: 2016-03-26 15:24:44 -0700 (Sat, 26 Mar 2016)
Log Message:
-----------
add SQABS and SQLABS macros for taking absolute values of sqInt and sqLong
Modified Paths:
--------------
branches/Cog/platforms/Cross/vm/sqMemoryAccess.h
Modified: branches/Cog/platforms/Cross/vm/sqMemoryAccess.h
===================================================================
--- branches/Cog/platforms/Cross/vm/sqMemoryAccess.h 2016-03-26 02:06:14 UTC (rev 3652)
+++ branches/Cog/platforms/Cross/vm/sqMemoryAccess.h 2016-03-26 22:24:44 UTC (rev 3653)
@@ -41,26 +41,32 @@
#if defined(SQ_IMAGE32)
typedef int sqInt;
typedef unsigned int usqInt;
+# define SQABS abs
#elif defined(SQ_HOST64)
typedef long sqInt;
typedef unsigned long usqInt;
+# define SQABS labs
#elif (SIZEOF_LONG_LONG != 8)
# error long long integers are not 64-bits wide?
#else
typedef long long sqInt;
typedef unsigned long long usqInt;
+# define SQABS llabs
#endif
#if !defined(sqLong)
# if SIZEOF_VOID_P == 8
# define sqLong long
# define usqLong unsigned long
+# define SQLABS labs
# elif _MSC_VER
# define sqLong __int64
# define usqLong unsigned __int64
+# define SQLABS llabs
# else
# define sqLong long long
# define usqLong unsigned long long
+# define SQLABS llabs
# endif
#endif /* !defined(sqLong) */
More information about the Vm-dev
mailing list