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.

67 lines
1.4 KiB

  1. //
  2. // Code to help free modules from the bondage and tyranny of CRT libraries
  3. //
  4. // Include this header in a single component and #define CPP_FUNCTIONS
  5. //
  6. #if defined(__cplusplus) && defined(CPP_FUNCTIONS)
  7. #include "mem.h"
  8. #undef new
  9. void * __cdecl operator new(size_t nSize)
  10. {
  11. return cicMemAllocClear((UINT)nSize);
  12. }
  13. void __cdecl operator delete(void *pv)
  14. {
  15. cicMemFree(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_