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.

74 lines
2.5 KiB

  1. /*******************************************************************************
  2. nocrt.h - C Runtime headers for those who are lazy...
  3. Owner: Mikel
  4. Created: 5 Dec 94
  5. *******************************************************************************/
  6. #ifndef _NOCRT_H_
  7. #define _NOCRT_H_
  8. #define _INC_STDLIB // force stdlib.h not to be included
  9. #define _INC_STRING // same with string.h
  10. #define _CTYPE_DISABLE_MACROS // same with ctype macros
  11. #define _CTYPE_DEFINED
  12. #define _INC_ERRNO
  13. #define _INC_STDDEF
  14. #define ERANGE 34 // used in errno for overflow
  15. /* Redefined C runtime calls. Couldn't do it for FillBuf though
  16. */
  17. #define isalpha(c) IsCharAlpha(c)
  18. #define isalnum(c) IsCharAlphaNumeric(c)
  19. #define isdigit(c) (IsCharAlphaNumeric(c) && !IsCharAlpha(c))
  20. #define isupper(c) IsCharUpper(c)
  21. #define memmove(m1, m2, n) MoveMemory(m1, m2, n)
  22. #define strcat(s1, s2) lstrcat(s1, s2)
  23. #define strcpy(d, s) lstrcpy(d, s)
  24. #define strcmp(s1, s2) lstrcmp(s1, s2)
  25. #define stricmp(s1, s2) lstrcmpi(s1, s2)
  26. #define strlen(s) lstrlen(s)
  27. #define strncpy(s1, s2, n) StrCpyN(s1, s2, n)
  28. #define tolower(c) ((TCHAR) CharLower((LPTSTR)MAKELONG(c, 0)))
  29. #define toupper(c) ((TCHAR) CharUpper((LPTSTR)MAKELONG(c, 0)))
  30. #define strncmp(s1, s2, n) StrCmpN(s1, s2, n)
  31. #define atoi(s1) StrToInt(s1)
  32. #ifndef __cplusplus
  33. /* These are defined in nocrt2.h for C++. Weird.
  34. */
  35. #define MsoIsEqualGuid(g1, g2) \
  36. (!StrCmpNA((const CHAR *)g1, (const CHAR *)g2, sizeof(GUID)))
  37. #define MsoIsEqualIid(i1, i2) \
  38. MsoIsEqualGuid(i1, i2)
  39. #define MsoIsEqualClsid(c1, c2) \
  40. MsoIsEqualGuid(c1, c2)
  41. #endif
  42. /* Runtimes we have to write ourselves, can't use Windows */
  43. #include <ctype.h> // get wchar_t defined
  44. int isspace(int);
  45. #ifdef UNICODE
  46. long strtol(const wchar_t *, wchar_t **, int);
  47. #else
  48. long strtol(const char *, char **, int);
  49. #endif
  50. /* Use this function instead of a bunch of strtok()s */
  51. #ifdef UNICODE
  52. int ScanDateNums(wchar_t *, wchar_t *, unsigned int [], int, int);
  53. #else
  54. int ScanDateNums(char *, char *, unsigned int [], int, int);
  55. #endif
  56. /* Needed to fake out IsEqualGUID() macro */
  57. #include <memory.h>
  58. #ifndef WINNT
  59. #pragma intrinsic(memcmp)
  60. #endif
  61. extern int errno;
  62. #endif // _NOCRT_H_