string-exports.h
1 /***************************************** *********************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 
14 #pragma once
15 
16 #if defined(__clang__)
17  #define BIOGEARS_STRING_API
18  #define BG_EXT
19 #elif defined(__gnu_linux__)
20  #define BIOGEARS_STRING_API __attribute__ ((visibility ("default")))
21  #define BG_EXT extern
22 #elif defined(_WIN32)
23  #ifdef biogears_string_EXPORTS
24  #define BIOGEARS_STRING_API __declspec(dllexport)
25  #else
26  #define BIOGEARS_STRING_API __declspec(dllimport)
27  #endif
28  #include<string>
29  #if _MSC_VER >= 1600 && _MSC_VER < 1910
30  #ifndef MSVC_2015_STRING_HACK
31  //#define MSVC_2015_STRING_HACK
32  //const std::basic_string<char>::size_type std::basic_string<char>::npos = static_cast<std::basic_string<char>::size_type>(-1);
33  #endif
34  #endif //_MSC_VER
35  //#pragma warning(push,0)
36  //template class BIOGEARS_STRING_API std::allocator<char>;
37  //template class BIOGEARS_STRING_API std::_String_alloc<std::_String_base_types<char, std::allocator<char>>>;
38  //template class BIOGEARS_STRING_API std::basic_string<char>;
39  //#pragma warning(pop)
40 #else
41  #define BIOGEARS_STRING_API
42  #define BG_EXT
43 #endif