add CHD support.
[pcsx_rearmed.git] / deps / libchdr / coretypes.h
CommitLineData
ce188d4d 1#ifndef __CORETYPES_H__
2#define __CORETYPES_H__
3
4#include <stdint.h>
5#include <stdio.h>
6
7#ifdef __LIBRETRO__
8#include <streams/file_stream_transforms.h>
9#endif
10
11#define ARRAY_LENGTH(x) (sizeof(x)/sizeof(x[0]))
12
13typedef uint64_t UINT64;
14typedef uint32_t UINT32;
15typedef uint16_t UINT16;
16typedef uint8_t UINT8;
17
18typedef int64_t INT64;
19typedef int32_t INT32;
20typedef int16_t INT16;
21typedef int8_t INT8;
22
23#define core_file FILE
24#define core_fopen(file) fopen(file, "rb")
25#define core_fseek fseek
26#define core_fread(fc, buff, len) fread(buff, 1, len, fc)
27#define core_fclose fclose
28#define core_ftell ftell
29
30static size_t core_fsize(core_file* f)
31{
32 size_t rv;
33 size_t p = ftell(f);
34 fseek(f, 0, SEEK_END);
35 rv = ftell(f);
36 fseek(f, p, SEEK_SET);
37 return rv;
38}
39
40#endif