1 /*****************************************************************************
2 * common.h: common definitions
3 * Collection of useful common types and macros definitions
4 *****************************************************************************
5 * Copyright (C) 1998, 1999, 2000 VideoLAN
8 * Authors: Sam Hocevar <sam@via.ecp.fr>
9 * Vincent Seguin <seguin@via.ecp.fr>
10 * Gildas Bazin <gbazin@netcourrier.com>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
25 *****************************************************************************/
27 /*****************************************************************************
28 * Basic types definitions
29 *****************************************************************************/
30 #if defined( HAVE_STDINT_H )
32 #elif defined( HAVE_INTTYPES_H )
33 # include <inttypes.h>
34 #elif defined( SYS_CYGWIN )
35 # include <sys/types.h>
36 /* Cygwin only defines half of these... */
37 typedef u_int8_t
uint8_t;
38 typedef u_int32_t
uint32_t;
40 /* Fallback types (very x86-centric, sorry) */
41 typedef unsigned char uint8_t;
42 typedef signed char int8_t;
43 typedef unsigned int uint32_t;
44 typedef signed int int32_t;
50 # define PATH_MAX MAX_PATH
53 /* several type definitions */
54 # if defined( __MINGW32__ )
55 # define lseek _lseeki64
56 # if !defined( _OFF_T_ )
57 typedef long long _off_t
;
61 # define off_t long long
65 # if defined( _MSC_VER )
66 # define lseek _lseeki64
67 # if !defined( _OFF_T_DEFINED )
68 typedef __int64 off_t
;
69 # define _OFF_T_DEFINED
71 # define off_t __int64
73 # define stat _stati64
77 # define snprintf _snprintf /* snprintf not defined in mingw32 (bug?) */