diff -Naur aotuv-b6.03_20110424-20150808-lancer/lib/codebook.c aotuv-b6.03_20110424-20150808-lancer-x64/lib/codebook.c
--- aotuv-b6.03_20110424-20150808-lancer/lib/codebook.c	2015-09-11 15:18:53 +0000
+++ aotuv-b6.03_20110424-20150808-lancer-x64/lib/codebook.c	2015-09-11 15:21:15 +0000
@@ -80,7 +80,7 @@
 /* Takes only up to 32 bits. */
 STIN vorbis_oggpack_write(oggpack_buffer *b, unsigned long value, int bits)
 {
-	unsigned long lvalue, hvalue;
+	uint32_t lvalue, hvalue;
 	if(b->endbyte+4>=b->storage){
 		b->buffer=realloc(b->buffer,b->storage+BUFFER_INCREMENT+4);
 		b->storage+=BUFFER_INCREMENT;
@@ -94,7 +94,7 @@
 	{
 		lvalue = value<<b->endbit;
 		lvalue |= (b->ptr[0]&mask[b->endbit]);
-		*(unsigned long*)(b->ptr) = lvalue;
+		*(uint32_t*)(b->ptr) = lvalue;
 	}
 	else
 	{
@@ -102,7 +102,7 @@
 		hvalue = value>>(32-b->endbit);
 		lvalue |= (b->ptr[0]&mask[b->endbit]);
 		b->ptr[4] = hvalue;
-		*(unsigned long*)(b->ptr) = lvalue;
+		*(uint32_t*)(b->ptr) = lvalue;
 	}
 
 	b->endbyte+=bits/8;
diff -Naur aotuv-b6.03_20110424-20150808-lancer/lib/os.h aotuv-b6.03_20110424-20150808-lancer-x64/lib/os.h
--- aotuv-b6.03_20110424-20150808-lancer/lib/os.h	2015-03-02 23:17:38 +0000
+++ aotuv-b6.03_20110424-20150808-lancer-x64/lib/os.h	2015-09-25 13:40:57 +0000
@@ -24,6 +24,10 @@
 #include <math.h>
 #include <ogg/os_types.h>
 
+#ifdef HAVE_STDINT_H
+#  include <stdint.h>
+#endif
+
 #include "misc.h"
 
 #ifndef _V_IFDEFJAIL_H_
diff -Naur aotuv-b6.03_20110424-20150808-lancer/lib/psy.h aotuv-b6.03_20110424-20150808-lancer-x64/lib/psy.h
--- aotuv-b6.03_20110424-20150808-lancer/lib/psy.h	2015-09-11 15:19:09 +0000
+++ aotuv-b6.03_20110424-20150808-lancer-x64/lib/psy.h	2015-09-25 13:43:02 +0000
@@ -22,6 +22,8 @@
 #include "backends.h"
 #include "envelope.h"
 
+#include "os.h"
+
 #ifndef EHMER_MAX
 #define EHMER_MAX 56
 #endif
@@ -104,7 +106,7 @@
 
   float *ath;
   long  *octave;             /* in n.ocshift format */
-  long  *bark;
+  int32_t *bark;
 
   long  firstoc;
   long  shiftoc;
diff -Naur aotuv-b6.03_20110424-20150808-lancer/lib/xmmlib.c aotuv-b6.03_20110424-20150808-lancer-x64/lib/xmmlib.c
--- aotuv-b6.03_20110424-20150808-lancer/lib/xmmlib.c	2014-10-18 23:34:31 +0000
+++ aotuv-b6.03_20110424-20150808-lancer-x64/lib/xmmlib.c	2015-09-11 15:21:15 +0000
@@ -23,28 +23,28 @@
 #include "xmmlib.h"
 
 #if	defined(__SSE__)
-_MM_ALIGN16 const unsigned long PCS_NNRN[4]	 = {0x00000000, 0x80000000, 0x00000000, 0x00000000};
-_MM_ALIGN16 const unsigned long PCS_NNRR[4]	 = {0x80000000, 0x80000000, 0x00000000, 0x00000000};
-_MM_ALIGN16 const unsigned long PCS_NRNN[4]	 = {0x00000000, 0x00000000, 0x80000000, 0x00000000};
-_MM_ALIGN16 const unsigned long PCS_NRNR[4]	 = {0x80000000, 0x00000000, 0x80000000, 0x00000000};
-_MM_ALIGN16 const unsigned long PCS_NRRN[4]	 = {0x00000000, 0x80000000, 0x80000000, 0x00000000};
-_MM_ALIGN16 const unsigned long PCS_NRRR[4]	 = {0x80000000, 0x80000000, 0x80000000, 0x00000000};
-_MM_ALIGN16 const unsigned long PCS_RNNN[4]	 = {0x00000000, 0x00000000, 0x00000000, 0x80000000};
-_MM_ALIGN16 const unsigned long PCS_RNRN[4]	 = {0x00000000, 0x80000000, 0x00000000, 0x80000000};
-_MM_ALIGN16 const unsigned long PCS_RNRR[4]	 = {0x80000000, 0x80000000, 0x00000000, 0x80000000};
-_MM_ALIGN16 const unsigned long PCS_RRNN[4]	 = {0x00000000, 0x00000000, 0x80000000, 0x80000000};
-_MM_ALIGN16 const unsigned long PCS_RNNR[4]	 = {0x80000000, 0x00000000, 0x00000000, 0x80000000};
-_MM_ALIGN16 const unsigned long PCS_RRRR[4]	 = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
-_MM_ALIGN16 const unsigned long PCS_NNNR[4]	 = {0x80000000, 0x00000000, 0x00000000, 0x00000000};
-_MM_ALIGN16 const unsigned long PABSMASK[4]	 = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};
-_MM_ALIGN16 const unsigned long PSTARTEDGEM1[4]	 = {0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
-_MM_ALIGN16 const unsigned long PSTARTEDGEM2[4]	 = {0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF};
-_MM_ALIGN16 const unsigned long PSTARTEDGEM3[4]	 = {0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF};
-_MM_ALIGN16 const unsigned long PENDEDGEM1[4]	 = {0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000};
-_MM_ALIGN16 const unsigned long PENDEDGEM2[4]	 = {0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000};
-_MM_ALIGN16 const unsigned long PENDEDGEM3[4]	 = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000};
+_MM_ALIGN16 const uint32_t PCS_NNRN[4]	 = {0x00000000, 0x80000000, 0x00000000, 0x00000000};
+_MM_ALIGN16 const uint32_t PCS_NNRR[4]	 = {0x80000000, 0x80000000, 0x00000000, 0x00000000};
+_MM_ALIGN16 const uint32_t PCS_NRNN[4]	 = {0x00000000, 0x00000000, 0x80000000, 0x00000000};
+_MM_ALIGN16 const uint32_t PCS_NRNR[4]	 = {0x80000000, 0x00000000, 0x80000000, 0x00000000};
+_MM_ALIGN16 const uint32_t PCS_NRRN[4]	 = {0x00000000, 0x80000000, 0x80000000, 0x00000000};
+_MM_ALIGN16 const uint32_t PCS_NRRR[4]	 = {0x80000000, 0x80000000, 0x80000000, 0x00000000};
+_MM_ALIGN16 const uint32_t PCS_RNNN[4]	 = {0x00000000, 0x00000000, 0x00000000, 0x80000000};
+_MM_ALIGN16 const uint32_t PCS_RNRN[4]	 = {0x00000000, 0x80000000, 0x00000000, 0x80000000};
+_MM_ALIGN16 const uint32_t PCS_RNRR[4]	 = {0x80000000, 0x80000000, 0x00000000, 0x80000000};
+_MM_ALIGN16 const uint32_t PCS_RRNN[4]	 = {0x00000000, 0x00000000, 0x80000000, 0x80000000};
+_MM_ALIGN16 const uint32_t PCS_RNNR[4]	 = {0x80000000, 0x00000000, 0x00000000, 0x80000000};
+_MM_ALIGN16 const uint32_t PCS_RRRR[4]	 = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
+_MM_ALIGN16 const uint32_t PCS_NNNR[4]	 = {0x80000000, 0x00000000, 0x00000000, 0x00000000};
+_MM_ALIGN16 const uint32_t PABSMASK[4]	 = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};
+_MM_ALIGN16 const uint32_t PSTARTEDGEM1[4]	 = {0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
+_MM_ALIGN16 const uint32_t PSTARTEDGEM2[4]	 = {0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF};
+_MM_ALIGN16 const uint32_t PSTARTEDGEM3[4]	 = {0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF};
+_MM_ALIGN16 const uint32_t PENDEDGEM1[4]	 = {0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000};
+_MM_ALIGN16 const uint32_t PENDEDGEM2[4]	 = {0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000};
+_MM_ALIGN16 const uint32_t PENDEDGEM3[4]	 = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000};
 
-_MM_ALIGN16 const unsigned long PMASKTABLE[4*16] = {
+_MM_ALIGN16 const uint32_t PMASKTABLE[4*16] = {
 	0x00000000, 0x00000000, 0x00000000, 0x00000000,
 	0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000,
 	0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000,
diff -Naur aotuv-b6.03_20110424-20150808-lancer/lib/xmmlib.h aotuv-b6.03_20110424-20150808-lancer-x64/lib/xmmlib.h
--- aotuv-b6.03_20110424-20150808-lancer/lib/xmmlib.h	2015-07-26 18:38:35 +0000
+++ aotuv-b6.03_20110424-20150808-lancer-x64/lib/xmmlib.h	2015-09-11 15:21:15 +0000
@@ -62,15 +62,15 @@
 typedef union {
 	unsigned char	si8[8];
 	unsigned short	si16[4];
-	unsigned long	si32[2];
+	uint32_t	si32[2];
 	char			ssi8[8];
 	short			ssi16[4];
-	long			ssi32[2];
+	int32_t			ssi32[2];
 	__m64			pi64;
 } __m64x;
 
 typedef union _INTRIN_TYPE _MM_ALIGN16 __m128x{
-	unsigned long	si32[4];
+	uint32_t	si32[4];
 	float			sf[4];
 	__m64			pi64[2];
 	__m128			ps;
@@ -86,27 +86,27 @@
 #define	_mm_lddqu_ps(x)	_mm_loadu_ps(x)
 #endif
 
-extern _MM_ALIGN16 const unsigned long PCS_NNRN[4];
-extern _MM_ALIGN16 const unsigned long PCS_NNRR[4];
-extern _MM_ALIGN16 const unsigned long PCS_NRNN[4];
-extern _MM_ALIGN16 const unsigned long PCS_NRNR[4];
-extern _MM_ALIGN16 const unsigned long PCS_NRRN[4];
-extern _MM_ALIGN16 const unsigned long PCS_NRRR[4];
-extern _MM_ALIGN16 const unsigned long PCS_RNNN[4];
-extern _MM_ALIGN16 const unsigned long PCS_RNRN[4];
-extern _MM_ALIGN16 const unsigned long PCS_RNRR[4];
-extern _MM_ALIGN16 const unsigned long PCS_RRNN[4];
-extern _MM_ALIGN16 const unsigned long PCS_RNNR[4];
-extern _MM_ALIGN16 const unsigned long PCS_RRRR[4];
-extern _MM_ALIGN16 const unsigned long PCS_NNNR[4];
-extern _MM_ALIGN16 const unsigned long PABSMASK[4];
-extern _MM_ALIGN16 const unsigned long PSTARTEDGEM1[4];
-extern _MM_ALIGN16 const unsigned long PSTARTEDGEM2[4];
-extern _MM_ALIGN16 const unsigned long PSTARTEDGEM3[4];
-extern _MM_ALIGN16 const unsigned long PENDEDGEM1[4];
-extern _MM_ALIGN16 const unsigned long PENDEDGEM2[4];
-extern _MM_ALIGN16 const unsigned long PENDEDGEM3[4];
-extern _MM_ALIGN16 const unsigned long PMASKTABLE[16*4];
+extern _MM_ALIGN16 const uint32_t PCS_NNRN[4];
+extern _MM_ALIGN16 const uint32_t PCS_NNRR[4];
+extern _MM_ALIGN16 const uint32_t PCS_NRNN[4];
+extern _MM_ALIGN16 const uint32_t PCS_NRNR[4];
+extern _MM_ALIGN16 const uint32_t PCS_NRRN[4];
+extern _MM_ALIGN16 const uint32_t PCS_NRRR[4];
+extern _MM_ALIGN16 const uint32_t PCS_RNNN[4];
+extern _MM_ALIGN16 const uint32_t PCS_RNRN[4];
+extern _MM_ALIGN16 const uint32_t PCS_RNRR[4];
+extern _MM_ALIGN16 const uint32_t PCS_RRNN[4];
+extern _MM_ALIGN16 const uint32_t PCS_RNNR[4];
+extern _MM_ALIGN16 const uint32_t PCS_RRRR[4];
+extern _MM_ALIGN16 const uint32_t PCS_NNNR[4];
+extern _MM_ALIGN16 const uint32_t PABSMASK[4];
+extern _MM_ALIGN16 const uint32_t PSTARTEDGEM1[4];
+extern _MM_ALIGN16 const uint32_t PSTARTEDGEM2[4];
+extern _MM_ALIGN16 const uint32_t PSTARTEDGEM3[4];
+extern _MM_ALIGN16 const uint32_t PENDEDGEM1[4];
+extern _MM_ALIGN16 const uint32_t PENDEDGEM2[4];
+extern _MM_ALIGN16 const uint32_t PENDEDGEM3[4];
+extern _MM_ALIGN16 const uint32_t PMASKTABLE[16*4];
 
 extern _MM_ALIGN16 const float PFV_0[4];
 extern _MM_ALIGN16 const float PFV_1[4];
@@ -157,7 +157,7 @@
 
 STIN __m128 _mm_untnorm_ps(__m128 x)
 {
-	static _MM_ALIGN16 const unsigned long PIV0[4] = {
+	static _MM_ALIGN16 const uint32_t PIV0[4] = {
 		0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000
 	};
 	register __m128 r;
