jpayne@69: /**************************************************************************** jpayne@69: * Copyright 2018-2020,2023 Thomas E. Dickey * jpayne@69: * Copyright 2009,2014 Free Software Foundation, Inc. * jpayne@69: * * jpayne@69: * Permission is hereby granted, free of charge, to any person obtaining a * jpayne@69: * copy of this software and associated documentation files (the * jpayne@69: * "Software"), to deal in the Software without restriction, including * jpayne@69: * without limitation the rights to use, copy, modify, merge, publish, * jpayne@69: * distribute, distribute with modifications, sublicense, and/or sell * jpayne@69: * copies of the Software, and to permit persons to whom the Software is * jpayne@69: * furnished to do so, subject to the following conditions: * jpayne@69: * * jpayne@69: * The above copyright notice and this permission notice shall be included * jpayne@69: * in all copies or substantial portions of the Software. * jpayne@69: * * jpayne@69: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * jpayne@69: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * jpayne@69: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * jpayne@69: * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * jpayne@69: * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * jpayne@69: * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * jpayne@69: * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * jpayne@69: * * jpayne@69: * Except as contained in this notice, the name(s) of the above copyright * jpayne@69: * holders shall not be used in advertising or otherwise to promote the * jpayne@69: * sale, use or other dealings in this Software without prior written * jpayne@69: * authorization. * jpayne@69: ****************************************************************************/ jpayne@69: /* $Id: ncurses_dll.h.in,v 1.18 2023/05/06 20:12:43 tom Exp $ */ jpayne@69: jpayne@69: #ifndef NCURSES_DLL_H_incl jpayne@69: #define NCURSES_DLL_H_incl 1 jpayne@69: jpayne@69: /* jpayne@69: * MinGW gcc (unlike MSYS2 and Cygwin) should define _WIN32 and possibly _WIN64. jpayne@69: */ jpayne@69: #if defined(__MINGW64__) jpayne@69: jpayne@69: #ifndef _WIN64 jpayne@69: #define _WIN64 1 jpayne@69: #endif jpayne@69: jpayne@69: #elif defined(__MINGW32__) jpayne@69: jpayne@69: #ifndef _WIN32 jpayne@69: #define _WIN32 1 jpayne@69: #endif jpayne@69: jpayne@69: /* 2014-08-02 workaround for broken MinGW compiler. jpayne@69: * Oddly, only TRACE is mapped to trace - the other -D's are okay. jpayne@69: * suggest TDM as an alternative. jpayne@69: */ jpayne@69: #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) jpayne@69: jpayne@69: #ifdef trace jpayne@69: #undef trace jpayne@69: #define TRACE jpayne@69: #endif jpayne@69: jpayne@69: #endif /* broken compiler */ jpayne@69: jpayne@69: #endif /* MingW */ jpayne@69: jpayne@69: /* jpayne@69: * For reentrant code, we map the various global variables into SCREEN by jpayne@69: * using functions to access them. jpayne@69: */ jpayne@69: #define NCURSES_PUBLIC_VAR(name) _nc_##name jpayne@69: jpayne@69: #if defined(BUILDING_NCURSES) jpayne@69: # define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT jpayne@69: #else jpayne@69: # define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT jpayne@69: #endif jpayne@69: jpayne@69: #define NCURSES_WRAPPED_VAR(type,name) extern NCURSES_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) jpayne@69: jpayne@69: #define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API jpayne@69: #define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type jpayne@69: jpayne@69: /* jpayne@69: * These symbols hide dllimport/dllexport, for compilers which care about it. jpayne@69: */ jpayne@69: #if defined(__CYGWIN__) || (defined(_WIN32) || defined(_WIN64)) jpayne@69: # if defined(NCURSES_STATIC) /* "static" here only implies "not-a-DLL" */ jpayne@69: # define NCURSES_EXPORT_GENERAL_IMPORT jpayne@69: # define NCURSES_EXPORT_GENERAL_EXPORT jpayne@69: # else jpayne@69: # define NCURSES_EXPORT_GENERAL_IMPORT __declspec(dllimport) jpayne@69: # define NCURSES_EXPORT_GENERAL_EXPORT __declspec(dllexport) jpayne@69: # endif jpayne@69: # define NCURSES_API __cdecl jpayne@69: #else jpayne@69: # define NCURSES_EXPORT_GENERAL_IMPORT jpayne@69: # if (__GNUC__ >= 4) && !defined(__cplusplus) jpayne@69: # define NCURSES_EXPORT_GENERAL_EXPORT __attribute__((visibility ("default"))) jpayne@69: # else jpayne@69: # define NCURSES_EXPORT_GENERAL_EXPORT jpayne@69: # endif jpayne@69: # define NCURSES_API /* FIXME: __attribute__ ((cdecl)) is only available on x86 */ jpayne@69: #endif jpayne@69: jpayne@69: #endif /* NCURSES_DLL_H_incl */