1 /****************************************************************************
2 * Copyright 2018,2020 Thomas E. Dickey *
3 * Copyright 2009,2014 Free Software Foundation, Inc. *
5 * Permission is hereby granted, free of charge, to any person obtaining a *
6 * copy of this software and associated documentation files (the *
7 * "Software"), to deal in the Software without restriction, including *
8 * without limitation the rights to use, copy, modify, merge, publish, *
9 * distribute, distribute with modifications, sublicense, and/or sell *
10 * copies of the Software, and to permit persons to whom the Software is *
11 * furnished to do so, subject to the following conditions: *
13 * The above copyright notice and this permission notice shall be included *
14 * in all copies or substantial portions of the Software. *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24 * Except as contained in this notice, the name(s) of the above copyright *
25 * holders shall not be used in advertising or otherwise to promote the *
26 * sale, use or other dealings in this Software without prior written *
28 ****************************************************************************/
29 /* $Id: ncurses_dll.h.in,v 1.17 2020/09/05 17:58:47 juergen Exp $ */
31 #ifndef NCURSES_DLL_H_incl
32 #define NCURSES_DLL_H_incl 1
35 * MinGW gcc (unlike MSYS2 and Cygwin) should define _WIN32 and possibly _WIN64.
37 #if defined(__MINGW64__)
43 #elif defined(__MINGW32__)
49 /* 2014-08-02 workaround for broken MinGW compiler.
50 * Oddly, only TRACE is mapped to trace - the other -D's are okay.
51 * suggest TDM as an alternative.
53 #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
60 #endif /* broken compiler */
65 * For reentrant code, we map the various global variables into SCREEN by
66 * using functions to access them.
68 #define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name
70 #if defined(BUILDING_NCURSES)
71 # define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
73 # define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
76 #define NCURSES_WRAPPED_VAR(type,name) extern NCURSES_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
78 #define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
79 #define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
82 * These symbols hide dllimport/dllexport, for compilers which care about it.
84 #if defined(__CYGWIN__) || (defined(_WIN32) || defined(_WIN64))
85 # if defined(NCURSES_STATIC) /* "static" here only implies "not-a-DLL" */
86 # define NCURSES_EXPORT_GENERAL_IMPORT
87 # define NCURSES_EXPORT_GENERAL_EXPORT
89 # define NCURSES_EXPORT_GENERAL_IMPORT __declspec(dllimport)
90 # define NCURSES_EXPORT_GENERAL_EXPORT __declspec(dllexport)
92 # define NCURSES_API __cdecl
94 # define NCURSES_EXPORT_GENERAL_IMPORT
95 # define NCURSES_EXPORT_GENERAL_EXPORT
96 # define NCURSES_API /* FIXME: __attribute__ ((cdecl)) is only available on x86 */
99 #endif /* NCURSES_DLL_H_incl */