openalbridge/wrappers.c
changeset 2211 288360b78f30
parent 2210 1cb7118a77dd
child 2212 6b5da1a2765a
equal deleted inserted replaced
2210:1cb7118a77dd 2211:288360b78f30
    24 	
    24 	
    25 	extern ALint *Sources;
    25 	extern ALint *Sources;
    26 	
    26 	
    27 	void *Malloc (size_t nbytes){
    27 	void *Malloc (size_t nbytes){
    28 		void *aptr;
    28 		void *aptr;
    29 		if ( (aptr = malloc(nbytes)) == NULL) {
    29 		if ((aptr = malloc(nbytes)) == NULL) {
    30 			fprintf(stderr, "ERROR: not enough memory! malloc() failed");
    30 			fprintf(stderr, "ERROR: not enough memory! malloc() failed\n");
    31 			exit(-1);
    31 			exit(-1);
    32 		}
    32 		}
    33 		return aptr;
    33 		return aptr;
    34 	}
    34 	}
    35 	
    35 	
    36 	
    36 	
    37 	FILE *Fopen (const char *fname, char *mode)	{
    37 	FILE *Fopen (const char *fname, char *mode)	{
    38 		FILE *fp;
    38 		FILE *fp;
    39 		if ((fp=fopen(fname,mode)) == NULL)
    39 		if ((fp=fopen(fname,mode)) == NULL)
    40 			fprintf (stderr, "ERROR: can't open file %s in mode '%s'", fname, mode);
    40 			fprintf (stderr, "ERROR: can't open file %s in mode '%s'\n", fname, mode);
    41 		return fp;
    41 		return fp;
    42 	}
    42 	}
    43 	
    43 	
    44 	
    44 	
    45 	ALint AlGetError (const char *str) {
    45 	ALint AlGetError (const char *str) {