diff src/modplug/stdafx.h @ 2218:6907fc39b53f

That didn't merge properly. I'll try again at some other point.
author William Pitcock <nenolod@atheme.org>
date Fri, 07 Dec 2007 12:13:37 -0600
parents 3673c7ec4ea2
children 107c1fed3d92
line wrap: on
line diff
--- a/src/modplug/stdafx.h	Fri Dec 07 12:09:16 2007 -0600
+++ b/src/modplug/stdafx.h	Fri Dec 07 12:13:37 2007 -0600
@@ -9,7 +9,6 @@
 #ifndef _STDAFX_H_
 #define _STDAFX_H_
 
-#include "headers.h"
 
 #ifdef MSC_VER
 
@@ -20,9 +19,7 @@
 #include <mmsystem.h>
 #include <stdio.h>
 
-inline void ProcessPlugins(int n) {}
-
-#else
+#elif defined(__x86_64__) || defined(__powerpc64__)
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -39,20 +36,24 @@
 typedef unsigned short WORD;
 typedef unsigned char BYTE;
 typedef unsigned char * LPBYTE;
-#ifdef __cplusplus
 typedef bool BOOL;
-#endif
 typedef char * LPSTR;
 typedef void *  LPVOID;
 typedef int * LPLONG;
 typedef unsigned int * LPDWORD;
 typedef unsigned short * LPWORD;
 typedef const char * LPCSTR;
-typedef long long LONGLONG;
+typedef long LONGLONG;
 typedef void * PVOID;
 typedef void VOID;
 
+inline LONG MulDiv (int a, int b, int c)
+{
+  // if (!c) return 0;
+  return ((unsigned long)a * (unsigned long) b ) / c;
+}
 
+#define MODPLUG_NO_FILESAVE
 #define NO_AGC
 #define LPCTSTR LPCSTR
 #define lstrcpyn strncpy
@@ -63,7 +64,6 @@
 
 #define  GHND   0
 
-#ifdef __cplusplus
 inline signed char * GlobalAllocPtr(unsigned int, size_t size)
 {
   signed char * p = (signed char *) malloc(size);
@@ -72,13 +72,86 @@
   return p;
 }
 
-inline void ProcessPlugins(int) {}
+#define GlobalFreePtr(p) free((void *)(p))
+
+#define strnicmp(a,b,c)		strncasecmp(a,b,c)
+#define wsprintf			sprintf
+
+#ifndef FALSE
+#define FALSE	false
+#endif
+
+#ifndef TRUE
+#define TRUE	true
+#endif
+
+#else
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+typedef signed char CHAR;
+typedef unsigned char UCHAR;
+typedef unsigned char* PUCHAR;
+typedef unsigned short USHORT;
+#if defined(__x86_64__) || defined(__powerpc64__)
+typedef unsigned int ULONG;
+typedef unsigned int UINT;
+typedef unsigned int DWORD;
+typedef int LONG;
+typedef long LONGLONG;
+typedef int * LPLONG;
+typedef unsigned int * LPDWORD;
+#else
+typedef unsigned long ULONG;
+typedef unsigned long UINT;
+typedef unsigned long DWORD;
+typedef long LONG;
+typedef long long LONGLONG;
+typedef long * LPLONG;
+typedef unsigned long * LPDWORD;
+#endif
+typedef unsigned short WORD;
+typedef unsigned char BYTE;
+typedef unsigned char * LPBYTE;
+typedef bool BOOL;
+typedef char * LPSTR;
+typedef void *  LPVOID;
+typedef unsigned short * LPWORD;
+typedef const char * LPCSTR;
+typedef void * PVOID;
+typedef void VOID;
+
+inline LONG MulDiv (long a, long b, long c)
+{
+  // if (!c) return 0;
+  return ((unsigned long long) a * (unsigned long long) b ) / c;
+}
+
+#define MODPLUG_NO_FILESAVE
+#define NO_AGC
+#define LPCTSTR LPCSTR
+#define lstrcpyn strncpy
+#define lstrcpy strcpy
+#define lstrcmp strcmp
+#define WAVE_FORMAT_PCM 1
+//#define ENABLE_EQ
+
+#define  GHND   0
+
+inline signed char * GlobalAllocPtr(unsigned int, size_t size)
+{
+  signed char * p = (signed char *) malloc(size);
+
+  if (p != NULL) memset(p, 0, size);
+  return p;
+}
 
 #define GlobalFreePtr(p) free((void *)(p))
 
 #define strnicmp(a,b,c)		strncasecmp(a,b,c)
 #define wsprintf			sprintf
-#endif
 
 #ifndef FALSE
 #define FALSE	false