Index: include/attributes.h
===================================================================
--- include/attributes.h	(revision 1172)
+++ include/attributes.h	(working copy)
@@ -25,10 +25,12 @@
 #define LIBMPEG2_ATTRIBUTES_H
 
 /* use gcc attribs to align critical data structures */
-#ifdef ATTRIBUTE_ALIGNED_MAX
-#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
+#if defined(ATTRIBUTE_ALIGNED_MAX)
+#define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < n) ? ATTRIBUTE_ALIGNED_MAX : n)))
+#elif defined(_MSC_VER)
+#define DECLARE_ALIGNED(n,t,v) t __declspec(align(n)) v 
 #else
-#define ATTR_ALIGN(align)
+#define DECLARE_ALIGNED(n,t,v) t v
 #endif
 
 #ifdef HAVE_BUILTIN_EXPECT
Index: vc++/config.h
===================================================================
--- vc++/config.h	(revision 1172)
+++ vc++/config.h	(working copy)
@@ -1,7 +1,9 @@
 /* vc++/config.h - manually adapted from include/config.h.in */
 
 /* Suppress warnings relating to mismatched declarations */
+#ifdef _MSC_VER
 #pragma warning (disable:4028)
+#endif
 
 /* autodetect accelerations */
 #define ACCEL_DETECT
@@ -165,7 +167,7 @@
 
 /* Define as `__restrict' if that's what the C compiler calls it, or to
    nothing if it is not supported. */
-#define restrict __restrict
+//#define restrict __restrict
 
 /* Define to `unsigned' if <sys/types.h> does not define. */
 /* #undef size_t */
Index: libmpeg2/mpeg2_internal.h
===================================================================
--- libmpeg2/mpeg2_internal.h	(revision 1172)
+++ libmpeg2/mpeg2_internal.h	(working copy)
@@ -97,7 +97,7 @@
     int16_t dc_dct_pred[3];
 
     /* DCT coefficients */
-    int16_t DCTblock[64] ATTR_ALIGN(64);
+    DECLARE_ALIGNED(64, int16_t, DCTblock[64]);
 
     uint8_t * picture_dest[3];
     void (* convert) (void * convert_id, uint8_t * const * src,
Index: libmpeg2/header.c
===================================================================
--- libmpeg2/header.c	(revision 1172)
+++ libmpeg2/header.c	(working copy)
@@ -40,7 +40,7 @@
 #define PIC_CODING_EXT 0x100
 
 /* default intra quant matrix, in zig-zag order */
-static const uint8_t default_intra_quantizer_matrix[64] ATTR_ALIGN(16) = {
+static const DECLARE_ALIGNED(16, uint8_t, default_intra_quantizer_matrix[64]) = {
     8,
     16, 16,
     19, 16, 19,
@@ -58,7 +58,7 @@
     83
 };
 
-uint8_t mpeg2_scan_norm[64] ATTR_ALIGN(16) = {
+DECLARE_ALIGNED(16, uint8_t, mpeg2_scan_norm[64]) = {
     /* Zig-Zag scan pattern */
      0,  1,  8, 16,  9,  2,  3, 10, 17, 24, 32, 25, 18, 11,  4,  5,
     12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13,  6,  7, 14, 21, 28,
@@ -66,7 +66,7 @@
     58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63
 };
 
-uint8_t mpeg2_scan_alt[64] ATTR_ALIGN(16) = {
+DECLARE_ALIGNED(16, uint8_t, mpeg2_scan_alt[64]) = {
     /* Alternate scan pattern */
      0, 8,  16, 24,  1,  9,  2, 10, 17, 25, 32, 40, 48, 56, 57, 49,
     41, 33, 26, 18,  3, 11,  4, 12, 19, 27, 34, 42, 50, 58, 35, 43,
