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-2017 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 #ifndef OPENCAD_H
32 #define OPENCAD_H
33 
34 #define OCAD_VERSION    "0.3.4"
35 #define OCAD_VERSION_MAJOR 0
36 #define OCAD_VERSION_MINOR 3
37 #define OCAD_VERSION_REV   4
38 
39 #ifndef OCAD_COMPUTE_VERSION
40 #define OCAD_COMPUTE_VERSION(maj,min,rev) ((maj)*10000+(min)*100+rev) // maj - any, min < 99, rev < 99
41 #endif
42 
43 #define OCAD_VERSION_NUM OCAD_COMPUTE_VERSION(OCAD_VERSION_MAJOR,OCAD_VERSION_MINOR,OCAD_VERSION_REV)
44 
45 /*  check if the current version is at least major.minor.revision */
46 #define CHECK_VERSION(major,minor,rev) \
47     (OCAD_VERSION_MAJOR > (major) || \
48     (OCAD_VERSION_MAJOR == (major) && OCAD_VERSION_MINOR > (minor)) || \
49     (OCAD_VERSION_MAJOR == (major) && OCAD_VERSION_MINOR == (minor) && OCAD_VERSION_REV >= (release)))
50 
51 #define DWG_VERSION_STR_SIZE  6
52 
53 #ifndef OCAD_EXTERN
54 #ifdef OCAD_STATIC
55   #define OCAD_EXTERN extern
56 #else
57 #   if defined (_MSC_VER)
58 #    ifdef OCAD_EXPORTS
59 #      define OCAD_EXTERN __declspec(dllexport) // extern
60 #      else
61 #      define OCAD_EXTERN __declspec(dllimport) // extern
62 #      endif
63 #    else
64 #     if defined(__GNUC__) && __GNUC__ >= 4
65 #       define OCAD_EXTERN __attribute__((visibility("default")))
66 #     else
67 #       define OCAD_EXTERN                extern
68 #     endif
69 #   endif
70 #endif
71 #endif
72 
73 #if defined(__GNUC__) && __GNUC__ >= 4
74 # define OCAD_PRINT_FUNC_FORMAT( format_idx, arg_idx ) __attribute__((__format__ (__printf__, format_idx, arg_idx)))
75 #else
76 #  define OCAD_PRINT_FUNC_FORMAT( format_idx, arg_idx )
77 #endif
78 
79 void DebugMsg(const char *, ...) OCAD_PRINT_FUNC_FORMAT (1,2);
80 
81 #endif // OPENCAD_H
82