some more segfault fixes
[mplayer.git] / libmpdvdkit2 / common.h
blobf3a60185eee356e04e43d75f2cae0b4a2855d556
1 /*****************************************************************************
2 * common.h: common definitions
3 * Collection of useful common types and macros definitions
4 *****************************************************************************
5 * Copyright (C) 1998, 1999, 2000 VideoLAN
6 * $Id$
8 * Authors: Samuel 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 #include <inttypes.h>
32 #ifdef __CYGWIN__
33 #define SYS_CYGWIN
34 #endif
36 #if defined( WIN32 )
38 #ifndef PATH_MAX
39 # define PATH_MAX MAX_PATH
40 #endif
42 /* several type definitions */
43 # if defined( __MINGW32__ )
44 # if !defined( _OFF_T_ )
45 typedef long long _off_t;
46 typedef _off_t off_t;
47 # define _OFF_T_
48 # else
49 # define off_t long long
50 # endif
51 # endif
53 # if defined( _MSC_VER )
54 # if !defined( _OFF_T_DEFINED )
55 typedef __int64 off_t;
56 # define _OFF_T_DEFINED
57 # else
58 # define off_t __int64
59 # endif
60 # define stat _stati64
61 # endif
63 # ifndef snprintf
64 # define snprintf _snprintf /* snprintf not defined in mingw32 (bug?) */
65 # endif
67 #endif