1 /*
2    mkvtoolnix - A set of programs for manipulating Matroska files
3 
4    Distributed under the GPL v2
5    see the file COPYING for details
6    or visit https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
7 
8    Cross platform compatibility definitions
9 
10    Written by Moritz Bunkus <moritz@bunkus.org>.
11 */
12 
13 #pragma once
14 
15 #include "config.h"
16 
17 #if (defined(_WIN32) || defined(WIN32) || defined(__MINGW32__)) && !defined(__CYGWIN__)
18 # define SYS_WINDOWS
19 #elif defined(__APPLE__)
20 # define SYS_APPLE
21 #else
22 # define COMP_GCC
23 # define SYS_UNIX
24 # if defined(__bsdi__) || defined(__FreeBSD__) || defined(__DragonFly__)
25 #  define SYS_BSD
26 # elif defined(__sun) && defined(__SUNPRO_CC)
27 #  undef COMP_GCC
28 #  define COMP_SUNPRO
29 #  define SYS_SOLARIS
30 # elif defined(__sun) && defined(__SVR4)
31 #  define SYS_SOLARIS
32 # elif defined(__CYGWIN__)
33 #  define COMP_CYGWIN
34 #  define SYS_CYGWIN
35 # else
36 #  define SYS_LINUX
37 # endif
38 #endif
39 
40 #if defined(SYS_WINDOWS)
41 # if defined __MINGW32__
42 #  define COMP_MINGW
43 # else
44 #  define COMP_MSC
45 #  define NOMINMAX
46 # endif
47 #endif
48 
49 #if defined(COMP_MSC)
50 
51 # define strncasecmp _strnicmp
52 # define strcasecmp _stricmp
53 
54 #define PACKED_STRUCTURE
55 #else // COMP_MSC
56 #define PACKED_STRUCTURE   __attribute__((__packed__))
57 #endif // COMP_MSC
58