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.

67 lines
1.4 KiB

  1. // Copyright (c) 1997 Microsoft Corporation. All Rights Reserved.
  2. //
  3. // Code to help free modules from the bondage and tyranny of CRT libraries
  4. //
  5. // Include this header in a single component and #define CPP_FUNCTIONS
  6. //
  7. #if defined(__cplusplus) && defined(CPP_FUNCTIONS)
  8. void * __cdecl operator new(unsigned int nSize)
  9. {
  10. // Zero init just to save some headaches
  11. return((LPVOID)LocalAlloc(LPTR, nSize));
  12. }
  13. void __cdecl operator delete(void *pv)
  14. {
  15. LocalFree((HLOCAL)pv);
  16. }
  17. extern "C" int __cdecl _purecall(void) {return 0;}
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #if defined(DEFINE_FLOAT_STUFF)
  23. // If you aren't using any floating-point CRT functions and you know
  24. // you aren't performing any float conversions or arithmetic, yet the
  25. // linker wants these symbols declared, then define DEFINE_FLOAT_STUFF.
  26. //
  27. // Warning: declaring these symbols in a component that needs floating
  28. // point support from the CRT will produce undefined results. (You will
  29. // need fp support from the CRT if you simply perform fp arithmetic.)
  30. int _fltused = 0;
  31. void __cdecl _fpmath(void) { }
  32. #endif
  33. #ifdef __cplusplus
  34. };
  35. #endif
  36. //
  37. // This file should be included in a global component header
  38. // to use the following
  39. //
  40. #ifndef __CRTFREE_H_
  41. #define __CRTFREE_H_
  42. #ifdef __cplusplus
  43. #ifndef _M_PPC
  44. #pragma intrinsic(memcpy)
  45. #pragma intrinsic(memcmp)
  46. #pragma intrinsic(memset)
  47. #endif
  48. #endif
  49. #endif // __CRTFREE_H_