Port to Sun C 5.11, which has __attribute__ ((__aligned (N))).
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Feb 2011 10:05:38 +0000 (02:05 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Feb 2011 10:05:38 +0000 (02:05 -0800)
* md5.h (ATTRIBUTE_ALIGNED): New macro.
(struct md5_ctx): Use it.

src/ChangeLog
src/md5.h

index 4ef9778..735f73b 100644 (file)
@@ -1,5 +1,9 @@
 2011-02-12  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Port to Sun C 5.11, which has __attribute__ ((__aligned (N))).
+       * md5.h (ATTRIBUTE_ALIGNED): New macro.
+       (struct md5_ctx): Use it.
+
        Port to Solaris 10, which doesn't support FC_HINT_STYLE.
        * xftfont.c (FC_HINT_STYLE): #define to "hintstyle" if not
        defined.
index 8ab7305..22bcdfd 100644 (file)
--- a/src/md5.h
+++ b/src/md5.h
@@ -72,9 +72,10 @@ typedef u_int32_t md5_uint32;
 #endif
 
 
-#ifndef __GNUC__
-#define __attribute__(X)
-#define __alignof__(X) 1
+#if HAVE_ATTRIBUTE_ALIGNED
+# define ATTRIBUTE_ALIGNED(N) __attribute__ ((__aligned__ (N)))
+#else
+# define ATTRIBUTE_ALIGNED(N)
 #endif
 
 /* Structure to save state of computation between the single steps.  */
@@ -87,7 +88,7 @@ struct md5_ctx
 
   md5_uint32 total[2];
   md5_uint32 buflen;
-  char buffer[128] __attribute__ ((__aligned__ (__alignof__ (md5_uint32))));
+  char buffer[128] ATTRIBUTE_ALIGNED (__alignof__ (md5_uint32));
 };
 
 /*
@@ -145,4 +146,3 @@ extern void *md5_buffer (const char *buffer, size_t len,
                          void *resblock);
 
 #endif /* md5.h */
-