3 * Copyright (C) 2011 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 * http://www.gnu.org/copyleft/gpl.html
23 #pragma warning(disable:4005) // Disable "warning C4005: '_WINSOCKAPI_' : macro redefinition"
25 #pragma warning(default:4005)
27 #include "../pthread_win32/pthread.h"
29 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
30 # define __USE_FILE_OFFSET64 1
33 typedef signed __int32
int32_t;
34 typedef signed __int64
int64_t;
35 typedef unsigned __int8
uint8_t;
36 typedef unsigned __int16
uint16_t;
37 typedef unsigned __int32
uint32_t;
38 typedef unsigned __int64
uint64_t;
40 #if defined __USE_FILE_OFFSET64
41 typedef int64_t off_t
;
42 typedef uint64_t ino_t
;
45 #define usleep(t) Sleep((t)/1000)
46 #define snprintf _snprintf
50 #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */
51 #pragma warning (push)
53 /* prevent inclusion of wingdi.h */
55 #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */
64 int tz_minuteswest
; /* minutes west of Greenwich */
65 int tz_dsttime
; /* type of dst correction */
69 \brief implements similar unix call under windows
70 \return 0 on success, -1 on failure (if pcur_time was NULL)
71 \param pcur_time points to a timeval structure, should not be NULL
72 \param tz points to a timezone structure, may be NULL
74 extern int gettimeofday(struct timeval
*pcur_time
, struct timezone
*tz
);