libopencad
opencad.h
1 /*******************************************************************************
2  * Project: libopencad
3  * Purpose: OpenSource CAD formats support library
4  * Author: Alexandr Borzykh, mush3d at gmail.com
5  * Author: Dmitry Baryshnikov, bishop.dev@gmail.com
6  * Language: C++
7  *******************************************************************************
8  * The MIT License (MIT)
9  *
10  * Copyright (c) 2016 Alexandr Borzykh
11  * Copyright (c) 2016 NextGIS, <info@nextgis.com>
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a copy
14  * of this software and associated documentation files (the "Software"), to deal
15  * in the Software without restriction, including without limitation the rights
16  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17  * copies of the Software, and to permit persons to whom the Software is
18  * furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included in all
21  * copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29  * SOFTWARE.
30  *******************************************************************************/
31 
32 #ifndef OPENCAD_H
33 #define OPENCAD_H
34 
35 #define OCAD_VERSION "0.1.0"
36 #define OCAD_VERSION_MAJOR 0
37 #define OCAD_VERSION_MINOR 1
38 #define OCAD_VERSION_REV 0
39 
40 #ifndef OCAD_COMPUTE_VERSION
41 #define OCAD_COMPUTE_VERSION(maj,min,rev) ((maj)*10000+(min)*100+rev) // maj - any, min < 99, rev < 99
42 #endif
43 
44 #define OCAD_VERSION_NUM OCAD_COMPUTE_VERSION(OCAD_VERSION_MAJOR,OCAD_VERSION_MINOR,OCAD_VERSION_REV)
45 
46 /* check if the current version is at least major.minor.revision */
47 #define CHECK_VERSION(major,minor,rev) \
48  (OCAD_VERSION_MAJOR > (major) || \
49  (OCAD_VERSION_MAJOR == (major) && OCAD_VERSION_MINOR > (minor)) || \
50  (OCAD_VERSION_MAJOR == (major) && OCAD_VERSION_MINOR == (minor) && OCAD_VERSION_REV >= (release)))
51 
52 #define DWG_VERSION_STR_SIZE 6
53 
54 #ifdef OCAD_STATIC
55  #define OCAD_EXTERN extern
56 #else
57 # if defined (_WIN32) || defined (WINDOWS)
58 # ifdef OCAD_EXPORTS
59 # ifdef __GNUC__
60 # define OCAD_EXTERN extern __attribute__((dllexport))
61 # else
62 # define OCAD_EXTERN extern __declspec(dllexport)
63 # endif
64 # else
65 # ifdef __GNUC__
66 # define OCAD_EXTERN extern __attribute__((dllimport))
67 # else
68 # define OCAD_EXTERN extern __declspec(dllimport)
69 # endif
70 # endif
71 # else
72 # if __GNUC__ >= 4
73 # define OCAD_EXTERN __attribute__((visibility("default")))
74 # else
75 # define OCAD_EXTERN extern
76 # endif
77 # endif
78 #endif
79 
80 
81 void DebugMsg(const char* format, ...);
82 
83 #endif // OPENCAD_H