OpcUaCanOpen
CANopen OPC-UA server
muParserFixes.h
Go to the documentation of this file.
1 /*
2  __________
3  _____ __ __\______ \_____ _______ ______ ____ _______
4  / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \
5  | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/
6  |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__|
7  \/ \/ \/ \/
8  Copyright (C) 2013 Ingo Berg
9 
10  Permission is hereby granted, free of charge, to any person obtaining a copy of this
11  software and associated documentation files (the "Software"), to deal in the Software
12  without restriction, including without limitation the rights to use, copy, modify,
13  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
14  permit persons to whom the Software is furnished to do so, subject to the following conditions:
15 
16  The above copyright notice and this permission notice shall be included in all copies or
17  substantial portions of the Software.
18 
19  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
20  NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
22  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25 
26 #ifndef MU_PARSER_FIXES_H
27 #define MU_PARSER_FIXES_H
28 
33 //
34 // Compatibility fixes
35 //
36 
37 //---------------------------------------------------------------------------
38 //
39 // Intel Compiler
40 //
41 //---------------------------------------------------------------------------
42 
43 #ifdef __INTEL_COMPILER
44 
45 // remark #981: operands are evaluated in unspecified order
46 // disabled -> completely pointless if the functions do not have side effects
47 //
48 #pragma warning(disable:981)
49 
50 // remark #383: value copied to temporary, reference to temporary used
51 #pragma warning(disable:383)
52 
53 // remark #1572: floating-point equality and inequality comparisons are unreliable
54 // disabled -> everyone knows it, the parser passes this problem
55 // deliberately to the user
56 #pragma warning(disable:1572)
57 
58 #endif
59 
60 
61 /* From http://gcc.gnu.org/wiki/Visibility */
62 /* Generic helper definitions for shared library support */
63 #if defined _WIN32 || defined __CYGWIN__
64 #define MUPARSER_HELPER_DLL_IMPORT __declspec(dllimport)
65 #define MUPARSER_HELPER_DLL_EXPORT __declspec(dllexport)
66 #define MUPARSER_HELPER_DLL_LOCAL
67 #else
68 #if __GNUC__ >= 4
69 #define MUPARSER_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
70 #define MUPARSER_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
71 #define MUPARSER_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
72 #else
73 #define MUPARSER_HELPER_DLL_IMPORT
74 #define MUPARSER_HELPER_DLL_EXPORT
75 #define MUPARSER_HELPER_DLL_LOCAL
76 #endif
77 #endif
78 
79 /* Now we use the generic helper definitions above to define API_EXPORT_CXX and MUPARSER_LOCAL.
80  * API_EXPORT_CXX is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
81  * MUPARSER_LOCAL is used for non-api symbols. */
82 
83 #ifndef MUPARSER_STATIC /* defined if muParser is compiled as a DLL */
84 #ifdef MUPARSERLIB_EXPORTS /* defined if we are building the muParser DLL (instead of using it) */
85 #define API_EXPORT_CXX MUPARSER_HELPER_DLL_EXPORT
86 #else
87 #define API_EXPORT_CXX MUPARSER_HELPER_DLL_IMPORT
88 #endif /* MUPARSER_DLL_EXPORTS */
89 #define MUPARSER_LOCAL MUPARSER_HELPER_DLL_LOCAL
90 #else /* MUPARSER_STATIC is defined: this means muParser is a static lib. */
91 #define API_EXPORT_CXX
92 #define MUPARSER_LOCAL
93 #endif /* !MUPARSER_STATIC */
94 
95 
96 #ifdef _WIN32
97 #define API_EXPORT(TYPE) API_EXPORT_CXX TYPE __cdecl
98 #else
99 #define API_EXPORT(TYPE) TYPE
100 #endif
101 
102 
103 #endif // include guard
104 
105