1166124Srafan/****************************************************************************
2174993Srafan * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
3166124Srafan *                                                                          *
4166124Srafan * Permission is hereby granted, free of charge, to any person obtaining a  *
5166124Srafan * copy of this software and associated documentation files (the            *
6166124Srafan * "Software"), to deal in the Software without restriction, including      *
7166124Srafan * without limitation the rights to use, copy, modify, merge, publish,      *
8166124Srafan * distribute, distribute with modifications, sublicense, and/or sell       *
9166124Srafan * copies of the Software, and to permit persons to whom the Software is    *
10166124Srafan * furnished to do so, subject to the following conditions:                 *
11166124Srafan *                                                                          *
12166124Srafan * The above copyright notice and this permission notice shall be included  *
13166124Srafan * in all copies or substantial portions of the Software.                   *
14166124Srafan *                                                                          *
15166124Srafan * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16166124Srafan * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17166124Srafan * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18166124Srafan * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19166124Srafan * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20166124Srafan * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21166124Srafan * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22166124Srafan *                                                                          *
23166124Srafan * Except as contained in this notice, the name(s) of the above copyright   *
24166124Srafan * holders shall not be used in advertising or otherwise to promote the     *
25166124Srafan * sale, use or other dealings in this Software without prior written       *
26166124Srafan * authorization.                                                           *
27166124Srafan ****************************************************************************/
28174993Srafan/* $Id: ncurses_dll.h,v 1.6 2007/03/10 19:21:49 tom Exp $ */
2976726Speter
3097049Speter#ifndef NCURSES_DLL_H_incl
3197049Speter#define NCURSES_DLL_H_incl 1
3276726Speter
33166124Srafan/* no longer needed on cygwin or mingw, thanks to auto-import       */
34166124Srafan/* but this structure may be useful at some point for an MSVC build */
35166124Srafan/* so, for now unconditionally define the important flags           */
36166124Srafan/* "the right way" for proper static and dll+auto-import behavior   */
37166124Srafan#undef NCURSES_DLL
38166124Srafan#define NCURSES_STATIC
3997049Speter
4076726Speter#if defined(__CYGWIN__)
4176726Speter#  if defined(NCURSES_DLL)
4276726Speter#    if defined(NCURSES_STATIC)
4376726Speter#      undef NCURSES_STATIC
4476726Speter#    endif
4576726Speter#  endif
4676726Speter#  undef NCURSES_IMPEXP
4776726Speter#  undef NCURSES_API
48166124Srafan#  undef NCURSES_EXPORT
49166124Srafan#  undef NCURSES_EXPORT_VAR
5076726Speter#  if defined(NCURSES_DLL)
5176726Speter/* building a DLL */
5276726Speter#    define NCURSES_IMPEXP __declspec(dllexport)
5376726Speter#  elif defined(NCURSES_STATIC)
5476726Speter/* building or linking to a static library */
5576726Speter#    define NCURSES_IMPEXP /* nothing */
5676726Speter#  else
5776726Speter/* linking to the DLL */
5876726Speter#    define NCURSES_IMPEXP __declspec(dllimport)
5976726Speter#  endif
6076726Speter#  define NCURSES_API __cdecl
6176726Speter#  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
6276726Speter#  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
6376726Speter#endif
6476726Speter
6576726Speter/* Take care of non-cygwin platforms */
6676726Speter#if !defined(NCURSES_IMPEXP)
6776726Speter#  define NCURSES_IMPEXP /* nothing */
6876726Speter#endif
6976726Speter#if !defined(NCURSES_API)
7076726Speter#  define NCURSES_API /* nothing */
7176726Speter#endif
7276726Speter#if !defined(NCURSES_EXPORT)
7376726Speter#  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
7476726Speter#endif
7576726Speter#if !defined(NCURSES_EXPORT_VAR)
7676726Speter#  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
7776726Speter#endif
7897049Speter
79174993Srafan/*
80174993Srafan * For reentrant code, we map the various global variables into SCREEN by
81174993Srafan * using functions to access them.
82174993Srafan */
83174993Srafan#define NCURSES_PUBLIC_VAR(name) _nc_##name
84174993Srafan#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void)
85174993Srafan
8697049Speter#endif /* NCURSES_DLL_H_incl */
87