S
Simon Elliott
I have some C code in a header which must be #included in both C and
C++ source files. The code in the header makes use of memcpy().
In bcb3 and bcb6, memcpy() needs <mem.h>. According to the g++ man page
for memcpy(), memcpy() needs <string.h>, and g++ complains that it
can't find <mem.h>
Is there anything in the standards which specify which header memcpy()
should require?
I'm aware of <cstring> but can't use it because this code must be both
valid C and C++
I don't want to end up with code which is stuffed full of #ifdef's for
all the different compilers I need to support. How do I deal with this
issue?
C++ source files. The code in the header makes use of memcpy().
In bcb3 and bcb6, memcpy() needs <mem.h>. According to the g++ man page
for memcpy(), memcpy() needs <string.h>, and g++ complains that it
can't find <mem.h>
Is there anything in the standards which specify which header memcpy()
should require?
I'm aware of <cstring> but can't use it because this code must be both
valid C and C++
I don't want to end up with code which is stuffed full of #ifdef's for
all the different compilers I need to support. How do I deal with this
issue?