home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / BOCOLE.PAK / PORTDEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  3.9 KB  |  192 lines

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