X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=include%2Fncurses_dll.h.in;h=469ab580618b4c17d4510f0217561b54a5ae967d;hp=676850cb4997f818559f0bcbe8857ab1a3f5cea9;hb=c976a90788f3e50afc773670ff74c5270ecb48df;hpb=73b54c0812e4b8dfddcf87f59c7488bb3c10e10d diff --git a/include/ncurses_dll.h.in b/include/ncurses_dll.h.in index 676850cb..469ab580 100644 --- a/include/ncurses_dll.h.in +++ b/include/ncurses_dll.h.in @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2014 Free Software Foundation, Inc. * + * Copyright 2018,2020 Thomas E. Dickey * + * Copyright 2009,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -25,17 +26,30 @@ * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ -/* $Id: ncurses_dll.h.in,v 1.9 2014/08/02 21:30:20 tom Exp $ */ +/* $Id: ncurses_dll.h.in,v 1.15 2020/04/04 23:37:36 tom Exp $ */ #ifndef NCURSES_DLL_H_incl #define NCURSES_DLL_H_incl 1 +/* + * MinGW gcc (unlike MSYS2 and Cygwin) should define _WIN32 and possibly _WIN64. + */ +#if defined(__MINGW64__) + +#ifndef _WIN64 +#define _WIN64 1 +#endif + +#elif defined(__MINGW32__) + +#ifndef _WIN32 +#define _WIN32 1 +#endif + /* 2014-08-02 workaround for broken MinGW compiler. * Oddly, only TRACE is mapped to trace - the other -D's are okay. * suggest TDM as an alternative. */ -#if defined(__MINGW64__) -#elif defined(__MINGW32__) #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) #ifdef trace @@ -44,6 +58,7 @@ #endif #endif /* broken compiler */ + #endif /* MingW */ /* @@ -51,7 +66,7 @@ * using functions to access them. */ #define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name -#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) +#define NCURSES_WRAPPED_VAR(type,name) extern NCURSES_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) /* no longer needed on cygwin or mingw, thanks to auto-import */ /* but this structure may be useful at some point for an MSVC build */ @@ -60,16 +75,21 @@ #undef NCURSES_DLL #define NCURSES_STATIC -#if defined(__CYGWIN__) || defined(__MINGW32__) +/* + * These are configurable: + */ +#undef NCURSES_API +#undef NCURSES_CXX_IMPEXP +#undef NCURSES_EXPORT +#undef NCURSES_EXPORT_VAR +#undef NCURSES_IMPEXP + +#if defined(__CYGWIN__) || defined(_WIN32) # if defined(NCURSES_DLL) # if defined(NCURSES_STATIC) # undef NCURSES_STATIC # endif # endif -# undef NCURSES_IMPEXP -# undef NCURSES_API -# undef NCURSES_EXPORT -# undef NCURSES_EXPORT_VAR # if defined(NCURSES_DLL) /* building a DLL */ # define NCURSES_IMPEXP __declspec(dllexport) @@ -85,9 +105,12 @@ # define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type #endif -/* Take care of non-cygwin platforms */ +/* Take care of non-Windows platforms */ #if !defined(NCURSES_IMPEXP) -# define NCURSES_IMPEXP /* nothing */ +# define NCURSES_IMPEXP @NCURSES_IMPEXP@ +#endif +#if !defined(NCURSES_CXX_IMPEXP) +# define NCURSES_CXX_IMPEXP @NCURSES_CXX_IMPEXP@ #endif #if !defined(NCURSES_API) # define NCURSES_API /* nothing */