openalbridge/wrappers.c
changeset 2213 bd51bbf06033
parent 2212 6b5da1a2765a
child 2216 82e7da49c26a
--- a/openalbridge/wrappers.c	Mon Jun 29 23:03:25 2009 +0000
+++ b/openalbridge/wrappers.c	Tue Jun 30 12:31:32 2009 +0000
@@ -24,7 +24,7 @@
 	
 	extern ALint *Sources;
 	
-	void *Malloc (size_t nbytes){
+	void *Malloc (size_t nbytes) {
 		void *aptr;
 		if ((aptr = malloc(nbytes)) == NULL) {
 			fprintf(stderr, "ERROR: not enough memory! malloc() failed\n");
@@ -34,6 +34,23 @@
 	}
 	
 	
+	void *Realloc (void *aptr, size_t nbytes) {
+#ifndef _WIN32
+		aptr = reallocf(aptr, nbytes);
+#else
+		aptr = realloc(aptr, nbytes);
+#endif
+		if (aptr == NULL) {
+			fprintf(stderr, "ERROR: not enough memory! realloc() failed\n");
+#ifdef _WIN32
+			free(aptr);
+#endif
+			exit(-1);
+		}
+		return aptr;
+	}
+	
+	
 	FILE *Fopen (const char *fname, char *mode)	{
 		FILE *fp;
 		if ((fp=fopen(fname,mode)) == NULL)
@@ -57,7 +74,7 @@
 #ifndef _WIN32
 	void *helper_fadein(void *tmp) 
 #else
-	void WINAPI helper_fadein(void *tmp) 
+	void *helper_fadein(void *tmp) 
 #endif
 	{
 		ALfloat gain;
@@ -103,7 +120,7 @@
 #ifndef _WIN32
 	void *helper_fadeout(void *tmp) 
 #else
-	void WINAPI helper_fadeout(void *tmp) 	
+	void *helper_fadeout(void *tmp) 	
 #endif
 	{
 		ALfloat gain;
@@ -144,6 +161,7 @@
 #endif
 	}
 	
+	
 #ifdef __CPLUSPLUS
 }
 #endif
\ No newline at end of file