ncurses_dll.h 3.8 KB

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