/[svn]/libgig/trunk/src/sysdef.h
ViewVC logotype

Contents of /libgig/trunk/src/sysdef.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4093 - (show annotations) (download) (as text)
Mon Feb 12 12:26:06 2024 UTC (2 weeks, 2 days ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 3149 byte(s)
* Move system dependent type and macro definitions into a shared header
  file sysdef.h (fixes compilation error with MSVC).

* Bumped version (4.4.0.svn2).

1
2 /***************************************************************************
3 * *
4 * Copyright (C) 2003-2024 Christian Schoenebeck *
5 * <cuse@users.sourceforge.net> *
6 * *
7 * This library is part of libgig. *
8 * *
9 * This library is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 * This library is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17 * GNU General Public License for more details. *
18 * *
19 * You should have received a copy of the GNU General Public License *
20 * along with this library; if not, write to the Free Software *
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
22 * MA 02111-1307 USA *
23 ***************************************************************************/
24
25 #ifndef LIBGIG_SYSDEF_H
26 #define LIBGIG_SYSDEF_H
27
28 #ifdef HAVE_CONFIG_H
29 # include <config.h>
30 #endif
31
32 #ifdef WIN32
33 # define POSIX 0
34 #endif
35
36 #ifndef POSIX
37 # define POSIX 1
38 #endif
39
40 #ifndef DEBUG
41 # define DEBUG 0
42 #endif
43
44 #if POSIX
45 # include <sys/types.h>
46 # include <sys/stat.h>
47 # include <fcntl.h>
48 # include <unistd.h>
49 #endif // POSIX
50
51 #if defined _MSC_VER && _MSC_VER < 1600
52 // Visual C++ 2008 doesn't have stdint.h
53 typedef __int8 int8_t;
54 typedef __int16 int16_t;
55 typedef __int32 int32_t;
56 typedef __int64 int64_t;
57 typedef unsigned __int8 uint8_t;
58 typedef unsigned __int16 uint16_t;
59 typedef unsigned __int32 uint32_t;
60 typedef unsigned __int64 uint64_t;
61 #else
62 #include <stdint.h>
63 #endif
64
65 #ifdef WIN32
66 # if (_WIN32 && !_WIN64) || (__GNUC__ && !(__x86_64__ || __ppc64__)) /* if 32 bit windows compilation */
67 # if _WIN32_WINNT < 0x0501
68 # undef _WIN32_WINNT
69 # define _WIN32_WINNT 0x0501 /* Win XP (no service pack): required for 32 bit compilation for GetFileSizeEx() to be declared by windows.h */
70 # endif
71 # endif
72 # include <windows.h>
73 typedef unsigned int uint;
74 #endif // WIN32
75
76 #ifdef _MSC_VER
77 #include <BaseTsd.h>
78 using ssize_t = SSIZE_T;
79 #endif
80
81 #ifndef OVERRIDE
82 # if defined(__cplusplus) && __cplusplus >= 201103L
83 # define OVERRIDE override
84 # else
85 # define OVERRIDE
86 # endif
87 #endif
88
89 #ifdef __GNUC__
90 # define LIBGIG_DEPRECATED_API(msg) __attribute__ ((deprecated(msg)))
91 #else
92 # define LIBGIG_DEPRECATED_API(msg)
93 #endif
94
95 #endif // LIBGIG_SYSDEF_H

  ViewVC Help
Powered by ViewVC