xref: /dflybsd-src/lib/libncurses/include/ncurses_dll.h (revision ee39cac471924701bfeab3ae2346eb967b9d56bf)
1946ecb11SJan Lentfer /****************************************************************************
2*ee39cac4SJohn Marino  * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
3946ecb11SJan Lentfer  *                                                                          *
4946ecb11SJan Lentfer  * Permission is hereby granted, free of charge, to any person obtaining a  *
5946ecb11SJan Lentfer  * copy of this software and associated documentation files (the            *
6946ecb11SJan Lentfer  * "Software"), to deal in the Software without restriction, including      *
7946ecb11SJan Lentfer  * without limitation the rights to use, copy, modify, merge, publish,      *
8946ecb11SJan Lentfer  * distribute, distribute with modifications, sublicense, and/or sell       *
9946ecb11SJan Lentfer  * copies of the Software, and to permit persons to whom the Software is    *
10946ecb11SJan Lentfer  * furnished to do so, subject to the following conditions:                 *
11946ecb11SJan Lentfer  *                                                                          *
12946ecb11SJan Lentfer  * The above copyright notice and this permission notice shall be included  *
13946ecb11SJan Lentfer  * in all copies or substantial portions of the Software.                   *
14946ecb11SJan Lentfer  *                                                                          *
15946ecb11SJan Lentfer  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16946ecb11SJan Lentfer  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17946ecb11SJan Lentfer  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18946ecb11SJan Lentfer  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19946ecb11SJan Lentfer  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20946ecb11SJan Lentfer  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21946ecb11SJan Lentfer  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22946ecb11SJan Lentfer  *                                                                          *
23946ecb11SJan Lentfer  * Except as contained in this notice, the name(s) of the above copyright   *
24946ecb11SJan Lentfer  * holders shall not be used in advertising or otherwise to promote the     *
25946ecb11SJan Lentfer  * sale, use or other dealings in this Software without prior written       *
26946ecb11SJan Lentfer  * authorization.                                                           *
27946ecb11SJan Lentfer  ****************************************************************************/
28*ee39cac4SJohn Marino /* $Id: ncurses_dll.h.in,v 1.8 2009/04/04 22:26:27 tom Exp $ */
29946ecb11SJan Lentfer 
30946ecb11SJan Lentfer #ifndef NCURSES_DLL_H_incl
31946ecb11SJan Lentfer #define NCURSES_DLL_H_incl 1
32946ecb11SJan Lentfer 
33*ee39cac4SJohn Marino /*
34*ee39cac4SJohn Marino  * For reentrant code, we map the various global variables into SCREEN by
35*ee39cac4SJohn Marino  * using functions to access them.
36*ee39cac4SJohn Marino  */
37*ee39cac4SJohn Marino #define NCURSES_PUBLIC_VAR(name) _nc_##name
38*ee39cac4SJohn Marino #define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void)
39*ee39cac4SJohn Marino 
40946ecb11SJan Lentfer /* no longer needed on cygwin or mingw, thanks to auto-import       */
41946ecb11SJan Lentfer /* but this structure may be useful at some point for an MSVC build */
42946ecb11SJan Lentfer /* so, for now unconditionally define the important flags           */
43946ecb11SJan Lentfer /* "the right way" for proper static and dll+auto-import behavior   */
44946ecb11SJan Lentfer #undef NCURSES_DLL
45946ecb11SJan Lentfer #define NCURSES_STATIC
46946ecb11SJan Lentfer 
47*ee39cac4SJohn Marino #if defined(__CYGWIN__) || defined(__MINGW32__)
48946ecb11SJan Lentfer #  if defined(NCURSES_DLL)
49946ecb11SJan Lentfer #    if defined(NCURSES_STATIC)
50946ecb11SJan Lentfer #      undef NCURSES_STATIC
51946ecb11SJan Lentfer #    endif
52946ecb11SJan Lentfer #  endif
53946ecb11SJan Lentfer #  undef NCURSES_IMPEXP
54946ecb11SJan Lentfer #  undef NCURSES_API
55946ecb11SJan Lentfer #  undef NCURSES_EXPORT
56946ecb11SJan Lentfer #  undef NCURSES_EXPORT_VAR
57946ecb11SJan Lentfer #  if defined(NCURSES_DLL)
58946ecb11SJan Lentfer /* building a DLL */
59946ecb11SJan Lentfer #    define NCURSES_IMPEXP __declspec(dllexport)
60946ecb11SJan Lentfer #  elif defined(NCURSES_STATIC)
61946ecb11SJan Lentfer /* building or linking to a static library */
62946ecb11SJan Lentfer #    define NCURSES_IMPEXP /* nothing */
63946ecb11SJan Lentfer #  else
64946ecb11SJan Lentfer /* linking to the DLL */
65946ecb11SJan Lentfer #    define NCURSES_IMPEXP __declspec(dllimport)
66946ecb11SJan Lentfer #  endif
67946ecb11SJan Lentfer #  define NCURSES_API __cdecl
68946ecb11SJan Lentfer #  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
69946ecb11SJan Lentfer #  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
70946ecb11SJan Lentfer #endif
71946ecb11SJan Lentfer 
72946ecb11SJan Lentfer /* Take care of non-cygwin platforms */
73946ecb11SJan Lentfer #if !defined(NCURSES_IMPEXP)
74946ecb11SJan Lentfer #  define NCURSES_IMPEXP /* nothing */
75946ecb11SJan Lentfer #endif
76946ecb11SJan Lentfer #if !defined(NCURSES_API)
77946ecb11SJan Lentfer #  define NCURSES_API /* nothing */
78946ecb11SJan Lentfer #endif
79946ecb11SJan Lentfer #if !defined(NCURSES_EXPORT)
80946ecb11SJan Lentfer #  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
81946ecb11SJan Lentfer #endif
82946ecb11SJan Lentfer #if !defined(NCURSES_EXPORT_VAR)
83946ecb11SJan Lentfer #  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
84946ecb11SJan Lentfer #endif
85946ecb11SJan Lentfer 
86946ecb11SJan Lentfer #endif /* NCURSES_DLL_H_incl */
87