xref: /dflybsd-src/lib/libncurses/include/ncurses_dll.h (revision 946ecb1103a9ce80f24431de8ca0952ac974347c)
1*946ecb11SJan Lentfer /****************************************************************************
2*946ecb11SJan Lentfer  * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
3*946ecb11SJan Lentfer  *                                                                          *
4*946ecb11SJan Lentfer  * Permission is hereby granted, free of charge, to any person obtaining a  *
5*946ecb11SJan Lentfer  * copy of this software and associated documentation files (the            *
6*946ecb11SJan Lentfer  * "Software"), to deal in the Software without restriction, including      *
7*946ecb11SJan Lentfer  * without limitation the rights to use, copy, modify, merge, publish,      *
8*946ecb11SJan Lentfer  * distribute, distribute with modifications, sublicense, and/or sell       *
9*946ecb11SJan Lentfer  * copies of the Software, and to permit persons to whom the Software is    *
10*946ecb11SJan Lentfer  * furnished to do so, subject to the following conditions:                 *
11*946ecb11SJan Lentfer  *                                                                          *
12*946ecb11SJan Lentfer  * The above copyright notice and this permission notice shall be included  *
13*946ecb11SJan Lentfer  * in all copies or substantial portions of the Software.                   *
14*946ecb11SJan Lentfer  *                                                                          *
15*946ecb11SJan Lentfer  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16*946ecb11SJan Lentfer  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17*946ecb11SJan Lentfer  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18*946ecb11SJan Lentfer  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19*946ecb11SJan Lentfer  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20*946ecb11SJan Lentfer  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21*946ecb11SJan Lentfer  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22*946ecb11SJan Lentfer  *                                                                          *
23*946ecb11SJan Lentfer  * Except as contained in this notice, the name(s) of the above copyright   *
24*946ecb11SJan Lentfer  * holders shall not be used in advertising or otherwise to promote the     *
25*946ecb11SJan Lentfer  * sale, use or other dealings in this Software without prior written       *
26*946ecb11SJan Lentfer  * authorization.                                                           *
27*946ecb11SJan Lentfer  ****************************************************************************/
28*946ecb11SJan Lentfer /* $Id: ncurses_dll.h,v 1.6 2007/03/10 19:21:49 tom Exp $ */
29*946ecb11SJan Lentfer 
30*946ecb11SJan Lentfer #ifndef NCURSES_DLL_H_incl
31*946ecb11SJan Lentfer #define NCURSES_DLL_H_incl 1
32*946ecb11SJan Lentfer 
33*946ecb11SJan Lentfer /* no longer needed on cygwin or mingw, thanks to auto-import       */
34*946ecb11SJan Lentfer /* but this structure may be useful at some point for an MSVC build */
35*946ecb11SJan Lentfer /* so, for now unconditionally define the important flags           */
36*946ecb11SJan Lentfer /* "the right way" for proper static and dll+auto-import behavior   */
37*946ecb11SJan Lentfer #undef NCURSES_DLL
38*946ecb11SJan Lentfer #define NCURSES_STATIC
39*946ecb11SJan Lentfer 
40*946ecb11SJan Lentfer #if defined(__CYGWIN__)
41*946ecb11SJan Lentfer #  if defined(NCURSES_DLL)
42*946ecb11SJan Lentfer #    if defined(NCURSES_STATIC)
43*946ecb11SJan Lentfer #      undef NCURSES_STATIC
44*946ecb11SJan Lentfer #    endif
45*946ecb11SJan Lentfer #  endif
46*946ecb11SJan Lentfer #  undef NCURSES_IMPEXP
47*946ecb11SJan Lentfer #  undef NCURSES_API
48*946ecb11SJan Lentfer #  undef NCURSES_EXPORT
49*946ecb11SJan Lentfer #  undef NCURSES_EXPORT_VAR
50*946ecb11SJan Lentfer #  if defined(NCURSES_DLL)
51*946ecb11SJan Lentfer /* building a DLL */
52*946ecb11SJan Lentfer #    define NCURSES_IMPEXP __declspec(dllexport)
53*946ecb11SJan Lentfer #  elif defined(NCURSES_STATIC)
54*946ecb11SJan Lentfer /* building or linking to a static library */
55*946ecb11SJan Lentfer #    define NCURSES_IMPEXP /* nothing */
56*946ecb11SJan Lentfer #  else
57*946ecb11SJan Lentfer /* linking to the DLL */
58*946ecb11SJan Lentfer #    define NCURSES_IMPEXP __declspec(dllimport)
59*946ecb11SJan Lentfer #  endif
60*946ecb11SJan Lentfer #  define NCURSES_API __cdecl
61*946ecb11SJan Lentfer #  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
62*946ecb11SJan Lentfer #  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
63*946ecb11SJan Lentfer #endif
64*946ecb11SJan Lentfer 
65*946ecb11SJan Lentfer /* Take care of non-cygwin platforms */
66*946ecb11SJan Lentfer #if !defined(NCURSES_IMPEXP)
67*946ecb11SJan Lentfer #  define NCURSES_IMPEXP /* nothing */
68*946ecb11SJan Lentfer #endif
69*946ecb11SJan Lentfer #if !defined(NCURSES_API)
70*946ecb11SJan Lentfer #  define NCURSES_API /* nothing */
71*946ecb11SJan Lentfer #endif
72*946ecb11SJan Lentfer #if !defined(NCURSES_EXPORT)
73*946ecb11SJan Lentfer #  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
74*946ecb11SJan Lentfer #endif
75*946ecb11SJan Lentfer #if !defined(NCURSES_EXPORT_VAR)
76*946ecb11SJan Lentfer #  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
77*946ecb11SJan Lentfer #endif
78*946ecb11SJan Lentfer 
79*946ecb11SJan Lentfer /*
80*946ecb11SJan Lentfer  * For reentrant code, we map the various global variables into SCREEN by
81*946ecb11SJan Lentfer  * using functions to access them.
82*946ecb11SJan Lentfer  */
83*946ecb11SJan Lentfer #define NCURSES_PUBLIC_VAR(name) _nc_##name
84*946ecb11SJan Lentfer #define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void)
85*946ecb11SJan Lentfer 
86*946ecb11SJan Lentfer #endif /* NCURSES_DLL_H_incl */
87