home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / text / hyper / ADtoHT2_0.lha / MyLib.lha / string / strcpy.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-14  |  511 b   |  41 lines

  1. #include <string.h>
  2.  
  3. /************************************************************************/
  4.  
  5. #undef strcpy
  6.  
  7. #if defined(__SASC_510)
  8.  
  9. char *strcpy(char *Dest, const char *Source)
  10.  
  11. {
  12.   return __builtin_strcpy(Dest,Source);
  13. }
  14.  
  15. #elif defined(__GNUC__) && defined(mc68000)
  16.  
  17. asm("
  18.     .globl    _strcpy
  19. _strcpy:
  20.     moveml    sp@(4:W),d0/a0
  21.     movel    d0,a1
  22. L1:    moveb    a0@+,a1@+
  23.     jne    L1
  24.     rts
  25. ");
  26.  
  27. #else
  28.  
  29. char *strcpy(char *Dest, const char *Source)
  30.  
  31. {
  32.   char *t;
  33.  
  34.   t=Dest;
  35.   while (*t++=*Source++)
  36.     ;
  37.   return Dest;
  38. }
  39.  
  40. #endif
  41.