home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / BOCOLE.PAK / PORTDEFS.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  4KB  |  192 lines

  1. //
  2. //**************************************************************************
  3. // 
  4. // PortDefs.h -- Contains some portability macros which are used to compile
  5. //               the same Bolero codebase for Win3.1 and Win32.
  6. //
  7. // Copyright (c) 1993,94 by Borland International, Inc. All rights reserved
  8. //
  9. //**************************************************************************
  10.  
  11. #ifndef _portdefs_h
  12. #define _portdefs_h
  13.  
  14. #ifdef WIN32
  15.  
  16. #    ifdef FAR
  17. #        undef FAR
  18. #    endif
  19.  
  20. #    ifdef _FAR
  21. #        undef _FAR
  22. #    endif
  23.  
  24. #    ifdef __FAR
  25. #        undef __FAR
  26. #    endif
  27.  
  28. #    ifdef PASCAL
  29. #        undef PASCAL
  30. #    endif
  31.  
  32. #    ifdef CDECL
  33. #        undef CDECL
  34. #    endif
  35.  
  36. #    ifdef _CDECL
  37. #        undef _CDECL
  38. #    endif
  39.  
  40. #    ifdef __CDECL
  41. #        undef __CDECL
  42. #    endif
  43.  
  44. #    ifdef HUGE
  45. #        undef HUGE
  46. #    endif
  47.  
  48. #    ifdef _HUGE
  49. #        undef _HUGE
  50. #    endif
  51.  
  52. #    ifdef __HUGE
  53. #        undef __HUGE
  54. #    endif
  55.  
  56. #    ifdef _LOADDS
  57. #        undef _LOADDS
  58. #    endif
  59.  
  60. #define PASCAL          __stdcall
  61. #define __STDC__        TRUE
  62.  
  63. #ifdef far
  64. #undef far
  65. #define far
  66. #endif
  67.  
  68. #define FAR            far
  69. #define _FAR
  70. #define __FAR
  71. #define _far
  72.  
  73.  
  74. #define CDECL
  75. #define __CDECL
  76. #define _CDECL
  77. #define _cdecl
  78.  
  79. #define HUGE
  80. #define _HUGE
  81. #define __HUGE
  82. #define huge
  83. #define _huge
  84.  
  85. #define _LOADDS
  86. #define _loadds
  87.  
  88. #define MAKEPOINT(l)       (*((POINT FAR *)&(l)))
  89.  
  90. #define SetViewportExt(a,b,c)   SetViewportExtEx(a,b,c,NULL)
  91. #define SetWindowExt(a,b,c)     SetWindowExtEx(a,b,c,NULL)
  92. #define SetWindowOrg(a,b,c)     SetWindowOrgEx(a,b,c,NULL)
  93. #define MoveTo(a,b,c)           MoveToEx(a,b,c,NULL)
  94. #define GetTextExtent(a,b,c)    GetTextExtentPoint(a,b,c,NULL)
  95. #define OffsetWindowOrg(a,b,c)  OffsetWindowOrgEx(a,b,c,NULL)  
  96.  
  97. #ifdef  strcmpi
  98. #undef  strcmpi
  99. #endif
  100.  
  101. // String operations on default character set (Unicode)
  102. #define strcpy(a,b)    lstrcpy(a,b)
  103. #define strlen(a)      lstrlen(a)
  104. #define strcat(a,b)    lstrcat(a,b)
  105. #define strcmp(a,b)    lstrcmp(a,b)
  106. #define strcmpi(a,b)   lstrcmpi(a,b)
  107. #define strupr(a)      CharUpper(a)
  108. #define strlwr(a)      CharLower(a)
  109.  
  110. // String operations on ANSI
  111. #define strcpyA(a,b)    lstrcpyA(a,b)
  112. #define strlenA(a)      lstrlenA(a)
  113. #define strcatA(a,b)    lstrcatA(a,b)
  114. #define strcmpA(a,b)    lstrcmpA(a,b)
  115. #define strcmpiA(a,b)   lstrcmpiA(a,b)
  116.  
  117. // String operations on Unicode
  118. #define strcpyW(a,b)    lstrcpyW(a,b)
  119. #define strlenW(a)      lstrlenW(a)
  120. #define strcatW(a,b)    lstrcatW(a,b)
  121. #define strcmpW(a,b)    lstrcmpW(a,b)
  122. #define strcmpiW(a,b)   lstrcmpW(a,b)
  123.  
  124. #else   /* For 16-bit */
  125.  
  126. // String operations on ANSI
  127. #define strcpyA(a,b)    strcpy(a,b)
  128. #define strlenA(a)      strlen(a)
  129. #define strcatA(a,b)    strcat(a,b)
  130. #define strcmpA(a,b)    strcmp(a,b)
  131. #define strcmpiA(a,b)   strcmpi(a,b)
  132.  
  133. // String operations on Unicode: NOT supported in 16 bits -> Generate error
  134. #define strcpyW(a,b)    strcpyW_is_not_supported_in_16_bit()
  135. #define strlenW(a)      strlenW_is_not_supported_in_16_bit()
  136. #define strcatW(a,b)    strcatW_is_not_supported_in_16_bit()
  137. #define strcmpW(a,b)    strcmpW_is_not_supported_in_16_bit()
  138. #define strcmpiW(a,b)   strcmpiW_is_not_supported_in_16_bit()
  139.  
  140. #ifndef __FAR
  141. #    define __FAR    __far
  142. #endif
  143.  
  144. #ifndef _CDECL
  145. #    define _CDECL    _cdecl
  146. #endif
  147.  
  148. #ifndef __CDECL
  149. #    define __CDECL    __cdecl
  150. #endif
  151.  
  152. #ifndef HUGE
  153. #    define HUGE        huge
  154. #endif
  155.  
  156. #ifndef _HUGE
  157. #    define  _HUGE    _huge
  158. #endif
  159.  
  160. #ifndef __HUGE
  161. #    define  __HUGE    __huge
  162. #endif
  163.  
  164. #ifndef _LOADDS
  165. #    define  _LOADDS    _loadds
  166. #endif
  167.  
  168. #define TEXT(quote) quote
  169.  
  170. #if ((!defined LPOLESTR) && (!defined UNICODE))
  171. #define LPOLESTR LPSTR
  172. #endif
  173.  
  174. #if ((!defined LPTSTR) && (!defined UNICODE))
  175. #define LPTSTR LPSTR
  176. #endif
  177.  
  178. #if ((!defined LPCOLESTR) && (!defined UNICODE))
  179. #define LPCOLESTR LPCSTR
  180. #define LPCTSTR LPCSTR
  181. #endif
  182.  
  183. #if ((!defined OLECHAR) && (!defined UNICODE))
  184. #define OLECHAR char
  185. #endif
  186.  
  187. #define OLESTR(s)  s
  188. #endif
  189.  
  190. #endif
  191.  
  192.