X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCutil.c;h=c3880127f82741ec8c13b22862f905a8366f9eb4;hb=80972b2e54c9b88f11c27b878874fd2a6a681391;hp=adfcff76c6a8e09308f25ec5efaff9b6f9f6608f;hpb=163f5f51d71510315430a335201ce0f1a7d71acb;p=fw%2Fsdcc diff --git a/src/SDCCutil.c b/src/SDCCutil.c index adfcff76..c3880127 100644 --- a/src/SDCCutil.c +++ b/src/SDCCutil.c @@ -197,7 +197,7 @@ dbuf_splitFile(const char *path, struct dbuf_s *file, struct dbuf_s *ext) } } -/** Combile directory and the file name to a path string using the DIR_SEPARATOR_CHAR. +/** Combine directory and the file name to a path string using the DIR_SEPARATOR_CHAR. */ void dbuf_makePath(struct dbuf_s *path,const char *dir, const char *file) @@ -375,7 +375,7 @@ char *strncatz(char *dest, const char *src, size_t n) /* paranoia... */ if (strlen(src) + destLen >= n) { - fprintf(stderr, "strncatz prevented buffer overrun!\n"); + fprintf(stderr, "strncatz prevented buffer overrun!\n"); } strncat(dest, src, maxToCopy); @@ -391,6 +391,40 @@ const char *getBuildNumber(void) return (SDCC_BUILD_NUMBER); } +/*-----------------------------------------------------------------*/ +/* getBuildDate - return build date */ +/*-----------------------------------------------------------------*/ +const char *getBuildDate(void) +{ + return (__DATE__); +} + +/*-----------------------------------------------------------------*/ +/* getBuildEnvironment - return environment used to build SDCC */ +/*-----------------------------------------------------------------*/ +const char *getBuildEnvironment(void) +{ +#ifdef __CYGWIN__ + return "CYGWIN"; +#elif defined __MINGW32__ + return "MINGW32"; +#elif defined __DJGPP__ + return "DJGPP"; +#elif defined(_MSC_VER) + return "MSVC"; +#elif defined(__BORLANDC__) + return "BORLANDC"; +#elif defined(__APPLE__) +# if defined(__i386__) + return "Mac OS X i386"; +# else + return "Mac OS X ppc"; +#endif +#else + return "UNIX"; +#endif +} + #if defined(HAVE_VSNPRINTF) || defined(HAVE_VSPRINTF) size_t SDCCsnprintf(char *dst, size_t n, const char *fmt, ...) {