BWAPI
trunk/bwapi/Util/Source/Util/Gnu.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #ifdef __GNUC__
00004 #include <string.h>
00005 
00006 #define fprintf_s fprintf
00007 #define sprintf_s snprintf
00008 #define vsnprintf_s(buf, s1, s2, fmt, ap) vsnprintf(buf, s1, fmt, ap)
00009 #define memcpy_s(dest, ds, src, ss) memcpy(dest, src, ss)
00010 
00011 inline void strcpy_s(char* dest, size_t size, char* src) {
00012     size_t s = strlen(src);
00013     if(s > size - 1) {
00014         s = size - 1;
00015     }
00016     memcpy(dest, src, s);
00017     dest[s] = 0;
00018 }
00019 #endif
00020 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines