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.

57 lines
999 B

  1. // crtfns.cpp -- Smaller implementations of the C runtime routines we use.
  2. #include "StdAfx.h"
  3. int __cdecl _purecall(void)
  4. {
  5. RonM_ASSERT(FALSE);
  6. return -1;
  7. }
  8. typedef void (__cdecl *_PVFV)(void);
  9. #ifdef i386 // To keep the alpha build working
  10. #pragma intrinsic(memset,memcpy)
  11. #endif // i386
  12. void * __stdcall memSet(void *dest, int chr, size_t count)
  13. {
  14. return memset(dest, chr, count);
  15. }
  16. void * __stdcall memCpy(void *dest, const void *src, size_t count)
  17. {
  18. return memcpy(dest, src, count);
  19. }
  20. wchar_t * __stdcall wcsCpy(wchar_t *wcsDest, const wchar_t *wcsSrc)
  21. {
  22. *wcsDest = 0;
  23. return wcsCat(wcsDest, wcsSrc);
  24. }
  25. wchar_t * __stdcall wcsCat(wchar_t *wcsDest, const wchar_t *wcsSrc)
  26. {
  27. wchar_t *pwcs = wcsDest;
  28. for (--wcsDest; *++wcsDest; );
  29. for (;;)
  30. if (!(*wcsDest++ = *wcsSrc++)) break;
  31. return pwcs;
  32. }
  33. wchar_t * __stdcall wcsChr(const wchar_t *src, wchar_t chr)
  34. {
  35. for (--src;;)
  36. {
  37. wchar_t wc = *++src;
  38. if (!wc) return NULL;
  39. if (wc == chr) return (wchar_t *) src;
  40. }
  41. }