2010-11-13 23:34:53 +01:00
|
|
|
#ifndef LIBWBFS_GLUE_H
|
|
|
|
#define LIBWBFS_GLUE_H
|
|
|
|
|
|
|
|
#include <gctypes.h>
|
2011-01-09 17:03:29 +01:00
|
|
|
#include "memory/mem2.h"
|
2010-11-13 23:34:53 +01:00
|
|
|
|
|
|
|
#define debug_printf(fmt, ...);
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2011-07-26 00:28:22 +02:00
|
|
|
#define wbfs_fatal(x) do { printf("\nwbfs panic: %s\n\n",x); return; } while(0)
|
|
|
|
#define wbfs_error(x) do { printf("\nwbfs error: %s\n\n",x); } while(0)
|
2010-11-13 23:34:53 +01:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
#define wbfs_malloc(x) MEM2_alloc(x)
|
|
|
|
#define wbfs_free(x) free(x)
|
|
|
|
#define wbfs_ioalloc(x) MEM2_alloc(((x) + 31) & ~31)
|
|
|
|
#define wbfs_iofree(x) free(x)
|
|
|
|
#define wbfs_be16(x) (*((u16*)(x)))
|
|
|
|
#define wbfs_be32(x) (*((u32*)(x)))
|
|
|
|
#define wbfs_ntohl(x) (x)
|
|
|
|
#define wbfs_htonl(x) (x)
|
|
|
|
#define wbfs_ntohs(x) (x)
|
|
|
|
#define wbfs_htons(x) (x)
|
2010-11-13 23:34:53 +01:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#define wbfs_memcmp(x,y,z) memcmp(x,y,z)
|
|
|
|
#define wbfs_memcpy(x,y,z) memcpy(x,y,z)
|
|
|
|
#define wbfs_memset(x,y,z) memset(x,y,z)
|
|
|
|
|
|
|
|
#endif
|