File: libziaint.h

package info (click to toggle)
libzia 4.36-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,320 kB
  • sloc: ansic: 24,172; sh: 4,408; makefile: 211
file content (127 lines) | stat: -rw-r--r-- 3,023 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
    libzia.h
    Copyright (C) 2011 Ladislav Vaiz <ok1zia@nagano.cz>

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    version 2 as published by the Free Software Foundation.

*/

#ifndef __LIBZIAINT_H
#define __LIBZIAINT_H

#ifdef _MSC_VER
#pragma warning(error:4013)
#endif

#include <zconfig.h>

// LIBZIA_EXPORTS must be defined in libzia.vcxcproj
#ifndef _MSC_VER
#define LIBZIA_API
#elif defined(LIBZIA_EXPORTS)
#define LIBZIA_API __declspec(dllexport)
#elif defined(LIBZIA_STATIC_LINK)
#define LIBZIA_API
#else
#define LIBZIA_API __declspec(dllimport)
#endif

/* predefined macros of compilers

gcc unix:                __GNUC__=4.3.2
i586-mingw32msvc-gcc:    WIN32 __GNUC__=4.2.1 __MINGW32__
gcc cygwin:              __CYGWIN__ __GNUC__=3.4.4
gcc cyg #inc<windows>:   WIN32 __CYGWIN__ __GNUC__=3.4.4
gcc cygwin -mno-cygwin:  WIN32 __GNUC__=3.4.4 __MINGW32__
msvc6:                   WIN32 _MSC_VER=12.00
msvc10 (vs2010):         WIN32 _MSC_VER=16.00
*/

#if defined(_MSC_VER)
#define Z_MSC
#define Z_PLATFORM "msvc"

#ifdef _WIN64
#define Z_MACHINE "win64"
#else
#define Z_MACHINE "win32"
#endif

#elif defined(__MINGW32__)
#define Z_MINGW
// Z_PLATFORM defined in unix/zconfig.h
// Z_MACHINE defined in unix/zconfig.h
#elif defined(__CYGWIN__)
#define Z_CYGWIN
#define Z_PLATFORM "cygwin"
#define Z_MACHINE "win32"
#elif defined(ANDROID)
#define Z_ANDROID
#define Z_PLATFORM "android"
#define Z_MACHINE "arm"
#elif defined(__APPLE__)
// Z_MACOS is subset of Z_UNIX
#define Z_MACOS
#define Z_UNIX 
// Z_PLATFORM is "darwin"
// Z_MACHINE is "x86_64"
#else
#define Z_UNIX
// Z_PLATFORM defined in unix/zconfig.h
// Z_MACHINE defined in unix/zconfig.h
#endif

#if defined(Z_MSC) || defined(Z_MINGW)
// MSVC or MINGW
#define Z_MSC_MINGW
#endif

#if defined(Z_MSC) || defined(Z_MINGW) || defined(Z_CYGWIN)
#define Z_MSC_MINGW_CYGWIN
#endif

#if defined(Z_MSC) || defined(Z_MINGW) || defined(Z_ANDROID)
#define Z_MSC_MINGW_ANDROID
#endif

#if defined(Z_CYGWIN) || defined(Z_UNIX)
// UNIX API available
#define Z_UNIX_CYGWIN
#endif

#if defined(Z_UNIX) || defined(Z_MINGW)
#define Z_UNIX_MINGW
#endif

#if defined(Z_UNIX) || defined(Z_ANDROID)
#define Z_UNIX_ANDROID
#endif

#if defined(Z_UNIX) || defined(Z_CYGWIN) || defined(Z_ANDROID)
#define Z_UNIX_CYGWIN_ANDROID
#endif

#if defined(Z_UNIX) || defined(Z_MINGW) || defined(Z_ANDROID)
#define Z_UNIX_MINGW_ANDROID
#endif


#define Z_SWAP(typ, a, b) { typ c; c = a; a = b; b = c; }
#define Z_MAX(a, b) ( (a) > (b) ? (a) : (b) )
#define Z_MIN(a, b) ( (a) < (b) ? (a) : (b) )
#define Z_ABS(a) ( (a) < 0 ? (-(a)) : (a) )

int z_min3(int a, int b, int c);

#ifdef Z_CYGWIN
#ifndef _MAX_PATH
#define _MAX_PATH 260
#endif
#endif

#define ZRET(statement) if ((ret = statement) < 0) return ret;
#define ZRETX(statement) if ((ret = statement) < 0) goto x;

#endif