miconv.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * Licensed Materials - Property of IBM and/or HCL
  3. *
  4. * IBM Informix Dynamic Server
  5. * (c) Copyright IBM Corporation 1996, 2008 All rights reserved.
  6. * (c) Copyright HCL Technologies Ltd. 2017. All Rights Reserved.
  7. *
  8. ***************************************************************************
  9. *
  10. * Title: miconv.h
  11. * Description:
  12. * MIAPI conventions and compiler specific switches
  13. * Changed from 6/18 for more flexible compilation
  14. *
  15. ***************************************************************************
  16. */
  17. #ifndef _MICONV_H_
  18. #define _MICONV_H_
  19. #include "ifxtypes.h"
  20. /*
  21. * New defines are MI_WINNT and MI_WIN31.
  22. * We still support WIN32 and MI_WIN31_PORT.
  23. */
  24. #ifdef WIN32
  25. #ifndef MI_WINNT
  26. #define MI_WINNT
  27. #endif /* MI_WINNT */
  28. #endif /* WIN32 */
  29. #ifdef MI_WIN31
  30. #ifndef MI_WIN31_PORT
  31. #define MI_WIN31_PORT
  32. #endif /* MI_WIN31_PORT */
  33. #endif /* MI_WIN31 */
  34. /*
  35. * Compiler-specific switches.
  36. */
  37. #if defined(_MSC_VER) || defined(__TURBOC__) || defined(WIN32) || defined(_WINDOWS) || defined(_WINDLL)
  38. #if !defined(MI_WINNT) && !defined(MI_WIN31)
  39. #define MI_WINNT
  40. #endif /* !WIN32 && !MI_WIN31_PORT */
  41. #endif /* PC compilers */
  42. /*
  43. * Microsoft compilers do not define __STDC__ if compiled with
  44. * microsoft extensions.
  45. */
  46. #if defined(MI_WINNT) || defined(MI_WIN31)
  47. #ifndef MI_HAS_STDC
  48. #define MI_HAS_STDC
  49. #endif /* MI_HAS_STDC */
  50. #ifndef MI_NO_PROTOTYPES
  51. #define MI_HAS_PROTOTYPES
  52. #endif /* MI_NO_PROTOTYPES */
  53. #endif /* pc compilers */
  54. #ifdef __STDC__
  55. #if __STDC__ > 0
  56. #if !defined(MI_HAS_STDC) && !defined(MI_NO_STDC)
  57. #define MI_HAS_STDC
  58. #define MI_HAS_SIGNED
  59. #ifndef MI_NO_STDARG
  60. #define MI_USE_STDARG
  61. #endif /* MI_NO_STDARG */
  62. #endif /* !MI_HAS_STDC && !MI_NO_STDC */
  63. #endif /* __STDC__ > 0 */
  64. #if !defined(MI_NO_STDC)
  65. #define MI_HAS_CONST
  66. #ifndef MI_NO_PROTOTYPES
  67. #define MI_HAS_PROTOTYPES
  68. #endif /* MI_NO_PROTOTYPES */
  69. #endif /* !MI_NO_STDC */
  70. #endif /* __STDC__ */
  71. #if defined(__cplusplus)
  72. #define MI_HAS_CONST
  73. #define MI_HAS_SIGNED
  74. #define MI_HAS_PROTOTYPES
  75. #ifndef MI_NO_STDARG
  76. #define MI_USE_STDARG
  77. #endif /* MI_NO_STDARG */
  78. #define EXTERNC_BEGIN extern "C" {
  79. #define EXTERNC_END }
  80. #else /* __cplusplus */
  81. #define EXTERNC_BEGIN
  82. #define EXTERNC_END
  83. #endif /* __cplusplus */
  84. #if !defined(MI_HAS_CONST)
  85. #define const
  86. #endif /* !defined(MI_HAS_CONST) */
  87. #if !defined(MI_HAS_SIGNED)
  88. #define signed
  89. #endif /* !defined(MI_HAS_SIGNED) */
  90. #ifndef ARGS
  91. #ifdef MI_HAS_PROTOTYPES
  92. #define ARGS(x) x
  93. #else /* MI_HAS_PROTOTYPES */
  94. #define ARGS(x) ()
  95. #endif /* MI_HAS_PROTOTYPES */
  96. #endif /* !ARGS */
  97. /* Windows compatibility */
  98. #define MI_FAR
  99. #define MI_PASCAL
  100. #define MI_CDECL
  101. #define MI_EXPORT
  102. /*
  103. * For a Windows DLL, all public functions are pascal convention.
  104. * Under UNIX, these just expand to nothing.
  105. */
  106. #define MI_PROC_EXPORT MI_FAR MI_PASCAL /* public API */
  107. #define MI_PROC_VAEXPORT MI_FAR MI_CDECL /* public varargs API.*/
  108. #define MI_PROC_CALLBACK MI_FAR MI_PASCAL MI_EXPORT /* callback function */
  109. #define MI_PROC_VACALLBACK MI_FAR MI_CDECL MI_EXPORT /* callback function */
  110. /*
  111. * On NT we use the macro MI_DECL to export all the SAPI functions and instead of
  112. * NT flag we use NT_MI_SAPI so that it doesnt affect client builds. For server builds
  113. * we use NT_SERVER to define MI_DECL to __declspec (dllexport)
  114. *
  115. */
  116. #ifndef NT_MI_SAPI
  117. #define MI_DECL
  118. #else /* !NT_MI_SAPI */
  119. #ifdef NT_SERVER
  120. #define MI_DECL __declspec (dllexport)
  121. #else /* NT_SERVER */
  122. #define MI_DECL __declspec (dllimport)
  123. #endif /* NT_SERVER */
  124. #endif /* !NT_MI_SAPI */
  125. #endif /* _MICONV_H_ */