1 /****************************************************************************
2 * Copyright (c) 1998-2009,2014 Free Software Foundation, Inc. *
4 * Permission is hereby granted, free of charge, to any person obtaining a *
5 * copy of this software and associated documentation files (the *
6 * "Software"), to deal in the Software without restriction, including *
7 * without limitation the rights to use, copy, modify, merge, publish, *
8 * distribute, distribute with modifications, sublicense, and/or sell *
9 * copies of the Software, and to permit persons to whom the Software is *
10 * furnished to do so, subject to the following conditions: *
12 * The above copyright notice and this permission notice shall be included *
13 * in all copies or substantial portions of the Software. *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 * Except as contained in this notice, the name(s) of the above copyright *
24 * holders shall not be used in advertising or otherwise to promote the *
25 * sale, use or other dealings in this Software without prior written *
27 ****************************************************************************/
28 /* $Id: ncurses_dll.h.in,v 1.9 2014/08/02 21:30:20 tom Exp $ */
30 #ifndef NCURSES_DLL_H_incl
31 #define NCURSES_DLL_H_incl 1
33 /* 2014-08-02 workaround for broken MinGW compiler.
34 * Oddly, only TRACE is mapped to trace - the other -D's are okay.
35 * suggest TDM as an alternative.
37 #if defined(__MINGW64__)
38 #elif defined(__MINGW32__)
39 #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
46 #endif /* broken compiler */
50 * For reentrant code, we map the various global variables into SCREEN by
51 * using functions to access them.
53 #define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name
54 #define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void)
56 /* no longer needed on cygwin or mingw, thanks to auto-import */
57 /* but this structure may be useful at some point for an MSVC build */
58 /* so, for now unconditionally define the important flags */
59 /* "the right way" for proper static and dll+auto-import behavior */
61 #define NCURSES_STATIC
63 #if defined(__CYGWIN__) || defined(__MINGW32__)
64 # if defined(NCURSES_DLL)
65 # if defined(NCURSES_STATIC)
66 # undef NCURSES_STATIC
69 # undef NCURSES_IMPEXP
71 # undef NCURSES_EXPORT
72 # undef NCURSES_EXPORT_VAR
73 # if defined(NCURSES_DLL)
75 # define NCURSES_IMPEXP __declspec(dllexport)
76 # elif defined(NCURSES_STATIC)
77 /* building or linking to a static library */
78 # define NCURSES_IMPEXP /* nothing */
80 /* linking to the DLL */
81 # define NCURSES_IMPEXP __declspec(dllimport)
83 # define NCURSES_API __cdecl
84 # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
85 # define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
88 /* Take care of non-cygwin platforms */
89 #if !defined(NCURSES_IMPEXP)
90 # define NCURSES_IMPEXP /* nothing */
92 #if !defined(NCURSES_API)
93 # define NCURSES_API /* nothing */
95 #if !defined(NCURSES_EXPORT)
96 # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
98 #if !defined(NCURSES_EXPORT_VAR)
99 # define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
102 #endif /* NCURSES_DLL_H_incl */