X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/7ca732f0714b3bdace7b2642923a7a0f4919e2d2..f5330ed0a9932ca87b5c5c013a54a98d784a8df2:/test-vasprintf.c?ds=sidebyside diff --git a/test-vasprintf.c b/test-vasprintf.c index 9515acdf..ee6980a2 100644 --- a/test-vasprintf.c +++ b/test-vasprintf.c @@ -1,4 +1,4 @@ -/* $Id: test-vasprintf.c,v 1.1 2015/03/19 14:57:29 schwarze Exp $ */ +/* $Id: test-vasprintf.c,v 1.4 2016/07/18 18:35:05 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * @@ -15,11 +15,18 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#if defined(__linux__) || defined(__MINT__) +#define _GNU_SOURCE /* vasprintf() */ +#endif + #include #include #include -int +static int testfunc(char **, const char *, ...); + + +static int testfunc(char **ret, const char *format, ...) { va_list ap; @@ -29,7 +36,7 @@ testfunc(char **ret, const char *format, ...) irc = vasprintf(ret, format, ap); va_end(ap); - return(irc); + return irc; } int @@ -38,8 +45,8 @@ main(void) char *ret; if (testfunc(&ret, "%s.", "Text") != 5) - return(1); + return 1; if (strcmp(ret, "Text.")) - return(2); - return(0); + return 2; + return 0; }