Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.5 KiB

  1. /***
  2. *v2tov3.h - macros for porting MS C v.2 to v.3 and later
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file defines macros which can be used to ease the problems
  8. * of porting MS C version 2.0 programs to MS C versions 3.0 and later.
  9. *
  10. * [Internal]
  11. *
  12. *Revision History:
  13. * 08-15-89 GJF Fixed copyright
  14. * 10-30-89 GJF Fixed copyright (again)
  15. * 03-02-90 GJF Added #ifndef _INC_V2TOV3 stuff
  16. * 02-14-95 CFW Clean up Mac merge.
  17. * 03-29-95 CFW Add error message to internal headers.
  18. * 12-14-95 JWM Add "#pragma once".
  19. * 02-24-97 GJF Detab-ed.
  20. *
  21. ****/
  22. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  23. #pragma once
  24. #endif
  25. #ifndef _INC_V2TOV3
  26. #define _INC_V2TOV3
  27. #ifndef _CRTBLD
  28. /*
  29. * This is an internal C runtime header file. It is used when building
  30. * the C runtimes only. It is not to be used as a public header file.
  31. */
  32. #error ERROR: Use of C runtime library internal header file.
  33. #endif /* _CRTBLD */
  34. #/* macro to translate the names used to force binary mode for files */
  35. #define O_RAW O_BINARY
  36. /* macro to translate setnbuf calls to the equivalent setbuf call */
  37. #define setnbuf(stream) setbuf(stream, NULL)
  38. /* macro to translate stclen calls to the equivalent strlen call */
  39. #define stclen(s) strlen(s)
  40. /* macro to translate stscmp calls to the equivalent strcmp call */
  41. #define stscmp(s,t) strcmp(s,t)
  42. /* macro to translate stpchr calls to the equivalent strchr call */
  43. #define stpchr(s,c) strchr(s,c)
  44. /* macro to translate stpbrk calls to the equivalent strpbrk call */
  45. #define stpbrk(s,b) strpbrk(s,b)
  46. /* macro to translate stcis calls to the equivalent strspn call */
  47. #define stcis(s1,s2) strspn(s1,s2)
  48. /* macro to translate stcisn calls to the equivalent strcspn call */
  49. #define stcisn(s1,s2) strcspn(s1,s2)
  50. /* macro to translate setmem calls to the equivalent memset call */
  51. #define setmem(p, n, c) memset(p, c, n)
  52. /* macro to translate movmem calls to the equivalent memcpy call */
  53. #define movmem(s, d, n) memcpy(d, s, n)
  54. /* MS C version 2.0 min, max, and abs macros */
  55. #define max(a,b) (((a) > (b)) ? (a) : (b))
  56. #define min(a,b) (((a) < (b)) ? (a) : (b))
  57. #define abs(a) (((a) < 0) ? -(a) : (a))
  58. /* macros which implement MS C version 2.0's extended ctype macros, iscym and
  59. * iscysmf
  60. */
  61. #define iscsymf(c) (isalpha(c) || ((c) == '_'))
  62. #define iscsym(c) (isalnum(c) || ((c) == '_'))
  63. #endif /* _INC_V2TOV3 */