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.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  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 strcat(s1,s2) lstrcatA(s1,s2)
  24. ///////////////////////////////////////////////////////////////////////
  25. //
  26. // C runtime excluders that we only use in non-debug builds
  27. //
  28. ////////////////////////////////////////////
  29. //
  30. // enable intrinsics that we can
  31. //
  32. #if !DBG
  33. #ifdef __cplusplus
  34. #ifndef _M_PPC
  35. #pragma intrinsic(memcpy)
  36. #pragma intrinsic(memcmp)
  37. #pragma intrinsic(memset)
  38. #endif
  39. #endif
  40. ////////////////////////////////////////////
  41. //
  42. // memory management
  43. //
  44. #define malloc(cb) ((void*)LocalAlloc(LPTR, cb))
  45. #define free(pv) (LocalFree((HLOCAL)pv))
  46. #define realloc(pv, cb) ((void*)LocalReAlloc((HLOCAL)pv, cb, LMEM_MOVEABLE))
  47. #endif // !DBG
  48. #endif