#pragma once
extern "C"
{
#pragma function(memset)
void * memset ( void * dest, int c, size_t count)
{
char * bytes = ( char * ) dest;
while ( count-- )
{
* bytes++ = ( char ) c;
}
return dest;
}
#pragma function(memcpy)
void * memcpy ( void * dest, const void * src, size_t count)
{
char * dest8 = ( char * ) dest;
const char * src8 = ( const char * ) src;
while ( count-- )
{
* dest8++ = * src8++ ;
}
return dest;
}
}
I3ByYWdtYSBvbmNlCgpleHRlcm4gIkMiCnsKCSNwcmFnbWEgZnVuY3Rpb24obWVtc2V0KQoJdm9pZCAqbWVtc2V0KHZvaWQgKmRlc3QsIGludCBjLCBzaXplX3QgY291bnQpCgl7CgkJY2hhciAqYnl0ZXMgPSAoY2hhciAqKWRlc3Q7CgkJd2hpbGUgKGNvdW50LS0pCgkJewoJCQkqYnl0ZXMrKyA9IChjaGFyKWM7CgkJfQoJCXJldHVybiBkZXN0OwoJfQoKCSNwcmFnbWEgZnVuY3Rpb24obWVtY3B5KQoJdm9pZCAqbWVtY3B5KHZvaWQgKmRlc3QsIGNvbnN0IHZvaWQgKnNyYywgc2l6ZV90IGNvdW50KQoJewoJCWNoYXIgKmRlc3Q4ID0gKGNoYXIgKilkZXN0OwoJCWNvbnN0IGNoYXIgKnNyYzggPSAoY29uc3QgY2hhciAqKXNyYzsKCQl3aGlsZSAoY291bnQtLSkKCQl7CgkJCSpkZXN0OCsrID0gKnNyYzgrKzsKCQl9CgkJcmV0dXJuIGRlc3Q7Cgl9Cn0=
compilation info
prog.cpp:1:9: warning: #pragma once in main file
#pragma once
^
prog.cpp:6:34: error: 'size_t' has not been declared
void *memset(void *dest, int c, size_t count)
^
prog.cpp:17:44: error: 'size_t' has not been declared
void *memcpy(void *dest, const void *src, size_t count)
^
stdout