1 #ifndef __PLATFORM_DEFS_H__
2 #define __PLATFORM_DEFS_H__
5 * Copyright (C) 2005-2008 Team XBMC
8 * This Program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This Program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with XBMC; see the file COPYING. If not, write to
20 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21 * http://www.gnu.org/copyleft/gpl.html
27 #define LINE_ENDING "\r\n"
29 #define __STDC_FORMAT_MACROS
32 typedef __int64 off64_t;
33 typedef __int64 fpos64_t;
34 typedef __int64 __off64_t;
36 typedef unsigned long ThreadIdentifier;
40 #define snprintf _snprintf
41 #define ftello64 _ftelli64
42 #define fseeko64 _fseeki64
44 #define strcasecmp strcmpi
47 #define strncasecmp strnicmp
55 #define pclose _pclose
58 #include <SDL/SDL_endian.h>
60 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
61 #define PIXEL_ASHIFT 0
62 #define PIXEL_RSHIFT 8
63 #define PIXEL_GSHIFT 16
64 #define PIXEL_BSHIFT 24
65 #define AMASK 0x000000ff
66 #define RMASK 0x0000ff00
67 #define GMASK 0x00ff0000
68 #define BMASK 0xff000000
71 #define PIXEL_ASHIFT 24
72 #define PIXEL_RSHIFT 16
73 #define PIXEL_GSHIFT 8
74 #define PIXEL_BSHIFT 0
75 #define AMASK 0xff000000
76 #define RMASK 0x00ff0000
77 #define GMASK 0x0000ff00
78 #define BMASK 0x000000ff
83 #define va_copy(dst, src) ((dst) = (src))
86 #define lrint(x) ((x) >= 0 ? ((int)((x) + 0.5)) : ((int)((x) - 0.5)))
87 #define llrint(x) ((x) >= 0 ? ((__int64)((x) + 0.5)) : ((__int64)((x) - 0.5)))
89 #define strtoll(p, e, b) _strtoi64(p, e, b)
91 extern "C" char * strptime(const char *buf, const char *fmt, struct tm *tm);
92 extern "C" int strverscmp (const char *s1, const char *s2);
93 extern "C" char * strcasestr(const char* haystack, const char* needle);
97 #endif //__PLATFORM_DEFS_H__