Leaked source code of windows server 2003
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.

61 lines
1.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1996
  6. //
  7. // File: crtem.h
  8. //
  9. // Contents: 'C' Run Time Emulation Definitions
  10. //
  11. // History: 03-Jun-96 philh created
  12. //--------------------------------------------------------------------------
  13. #ifndef __CRTEM_H__
  14. #define __CRTEM_H__
  15. ///////////////////////////////////////////////////////////////////////
  16. //
  17. // Definitions that help reduce our dependence on the C runtimes
  18. //
  19. #define wcslen(sz) lstrlenW(sz) // yes it IS implemented by Win95
  20. #define strlen(sz) lstrlenA(sz)
  21. #define strcpy(s1,s2) lstrcpyA(s1,s2)
  22. #define strcmp(s1,s2) lstrcmpA(s1,s2)
  23. #define _stricmp(s1,s2) lstrcmpiA(s1,s2)
  24. #define strcat(s1,s2) lstrcatA(s1,s2)
  25. ///////////////////////////////////////////////////////////////////////
  26. //
  27. // C runtime excluders that we only use in non-debug builds
  28. //
  29. ////////////////////////////////////////////
  30. //
  31. // enable intrinsics that we can
  32. //
  33. #if !DBG
  34. #ifdef __cplusplus
  35. #ifndef _M_PPC
  36. #pragma intrinsic(memcpy)
  37. #pragma intrinsic(memcmp)
  38. #pragma intrinsic(memset)
  39. #endif
  40. #endif
  41. ////////////////////////////////////////////
  42. //
  43. // memory management
  44. //
  45. #define malloc(cb) ((void*)LocalAlloc(LPTR, cb))
  46. #define free(pv) (LocalFree((HLOCAL)pv))
  47. #define realloc(pv, cb) ((void*)LocalReAlloc((HLOCAL)pv, cb, LMEM_MOVEABLE))
  48. #endif // !DBG
  49. #endif