diff --git a/src/tools/rc/Jamfile b/src/tools/rc/Jamfile index 4304b2bad7..5d1778f67b 100644 --- a/src/tools/rc/Jamfile +++ b/src/tools/rc/Jamfile @@ -4,6 +4,10 @@ GENERATE_C++ on [ FGristFiles lexer.l parser.y ] = true ; SubDirC++Flags -Wno-sign-compare -Wno-unused ; +local r5Compatibility = [ FDirName $(SUBDIR) R5Compatibility.h ] ; +SubDirCcFlags -include $(r5Compatibility) ; +SubDirC++Flags -include $(r5Compatibility) ; + StaticLibrary rdef : compile.cpp decompile.cpp lexer.l parser.y rdef.cpp ; diff --git a/src/tools/rc/R5Compatibility.h b/src/tools/rc/R5Compatibility.h new file mode 100644 index 0000000000..5e7e850500 --- /dev/null +++ b/src/tools/rc/R5Compatibility.h @@ -0,0 +1,22 @@ +#ifndef RC_R5_COMPATIBILITY_H +#define RC_R5_COMPATIBILITY_H + +#ifndef __HAIKU__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern size_t strnlen(const char *string, size_t count); +extern size_t strlcat(char *dest, const char *source, size_t length); +extern size_t strlcpy(char *dest, const char *source, size_t length); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // !__HAIKU__ + +#endif // RC_R5_COMPATIBILITY_H diff --git a/src/tools/rc/rc.cpp b/src/tools/rc/rc.cpp index 5ca7ad1162..f64f1c9b0a 100644 --- a/src/tools/rc/rc.cpp +++ b/src/tools/rc/rc.cpp @@ -43,12 +43,6 @@ static char sOutputFile[B_PATH_NAME_LENGTH] = { 0 }; static char *sFirstInputFile = NULL; -#ifndef __HAIKU__ -extern "C" size_t strlcat(char *dest, const char *source, size_t length); -extern "C" size_t strlcpy(char *dest, const char *source, size_t length); -#endif - - void warn(const char *format, ...) {