Metrowerks for Motorola tune-up.
authorAndy Polyakov <appro@openssl.org>
Sun, 2 Jan 2000 22:03:10 +0000 (22:03 +0000)
committerAndy Polyakov <appro@openssl.org>
Sun, 2 Jan 2000 22:03:10 +0000 (22:03 +0000)
crypto/md32_common.h
crypto/sha/sha_locl.h

index 470a8c3e512175a27554a7dff288085049399f63..a5b838442b398eb32ac7b901736fe50c850844de 100644 (file)
 # if defined(_MSC_VER)
 #  define ROTATE(a,n)  _lrotl(a,n)
 # elif defined(__MWERKS__)
-#  ifdef __POWERPC__
+#  if defined(__POWERPC__)
 #   define ROTATE(a,n) __rlwinm(a,n,0,31)
+#  elif defined(__MC68K__)
+    /* Motorola specific tweak. <appro@fy.chalmers.se> */
+#   define ROTATE(a,n) ( n<24 ? __rol(a,n) : __ror(a,32-n) )
 #  else
 #   define ROTATE(a,n) __rol(a,n)
 #  endif
index 80e70f046f7e0be46fb92e3311c93b93c9b1283e..0a78b399a9f883ccb44359df118f2d30158fb9f8 100644 (file)
 # define HASH_INIT                     SHA1_Init
 # define HASH_BLOCK_HOST_ORDER         sha1_block_host_order
 # define HASH_BLOCK_DATA_ORDER         sha1_block_data_order
-# define Xupdate(a,ix,ia,ib,ic,id)     ( (a)=(ia^ib^ic^id),    \
+# if defined(__MWERKS__) && defined(__MC68K__)
+   /* Metrowerks for Motorola fails otherwise:-( <appro@fy.chalmers.se> */
+#  define Xupdate(a,ix,ia,ib,ic,id)    do { (a)=(ia^ib^ic^id);         \
+                                            ix=(a)=ROTATE((a),1);      \
+                                       } while (0)
+# else
+#  define Xupdate(a,ix,ia,ib,ic,id)    ( (a)=(ia^ib^ic^id),    \
                                          ix=(a)=ROTATE((a),1)  \
                                        )
+# endif
 
 # ifdef SHA1_ASM
 #  if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)