Merge pull request #4775 from jmarshallnz/empty_episode_playcount
[vuplus_xbmc] / xbmc / win32 / PlatformDefs.h
1 #ifndef __PLATFORM_DEFS_H__
2 #define __PLATFORM_DEFS_H__
3
4 /*
5  *      Copyright (C) 2005-2013 Team XBMC
6  *      http://xbmc.org
7  *
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)
11  *  any later version.
12  *
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.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with XBMC; see the file COPYING.  If not, see
20  *  <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #ifdef TARGET_WINDOWS
25
26 #define LINE_ENDING "\r\n"
27
28 #define __STDC_FORMAT_MACROS
29 #include "inttypes.h"
30
31 typedef __int64       off64_t;
32 typedef __int64       fpos64_t;
33 typedef __int64       __off64_t;
34 typedef long          __off_t;
35
36 #define ssize_t int
37
38 #define snprintf _snprintf
39 #define ftello64 _ftelli64
40 #define fseeko64 _fseeki64
41 #ifndef strcasecmp
42 #define strcasecmp strcmpi
43 #endif
44 #ifndef strncasecmp
45 #define strncasecmp strnicmp
46 #endif
47
48 #define popen   _popen
49 #define pclose  _pclose
50
51 #if 0
52 // big endian
53 #define PIXEL_ASHIFT 0
54 #define PIXEL_RSHIFT 8
55 #define PIXEL_GSHIFT 16
56 #define PIXEL_BSHIFT 24
57 #define AMASK 0x000000ff
58 #define RMASK 0x0000ff00
59 #define GMASK 0x00ff0000
60 #define BMASK 0xff000000
61 #else
62 // little endian
63 #define PIXEL_ASHIFT 24
64 #define PIXEL_RSHIFT 16
65 #define PIXEL_GSHIFT 8
66 #define PIXEL_BSHIFT 0
67 #define AMASK 0xff000000
68 #define RMASK 0x00ff0000
69 #define GMASK 0x0000ff00
70 #define BMASK 0x000000ff
71 #endif
72
73 #ifndef va_copy
74 #define va_copy(dst, src) ((dst) = (src))
75 #endif
76
77 #define lrint(x) ((x) >= 0 ? ((int)((x) + 0.5)) : ((int)((x) - 0.5)))
78 #define llrint(x) ((x) >= 0 ? ((__int64)((x) + 0.5)) : ((__int64)((x) - 0.5)))
79
80 #define strtoll(p, e, b) _strtoi64(p, e, b)
81
82 extern "C" char * strptime(const char *buf, const char *fmt, struct tm *tm);
83 extern "C" int strverscmp (const char *s1, const char *s2);
84 extern "C" char * strcasestr(const char* haystack, const char* needle);
85
86 #endif // TARGET_WINDOWS
87
88 #endif //__PLATFORM_DEFS_H__
89