From: Paul Smith Date: Sat, 17 Dec 2016 18:16:22 +0000 (-0500) Subject: * po/Makevars, makeint.h, debug.h: Add xgettext C format flags. X-Git-Tag: 4.2.90~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=212cb00923606c89a0a00eff445f91405e5e459d;p=thirdparty%2Fmake.git * po/Makevars, makeint.h, debug.h: Add xgettext C format flags. --- diff --git a/debug.h b/debug.h index 17c394ba..29159750 100644 --- a/debug.h +++ b/debug.h @@ -27,6 +27,8 @@ extern int db_level; #define ISDB(_l) ((_l)&db_level) +/* When adding macros to this list be sure to update the value of + XGETTEXT_OPTIONS in the po/Makevars file. */ #define DBS(_l,_x) do{ if(ISDB(_l)) {print_spaces (depth); \ printf _x; fflush (stdout);} }while(0) diff --git a/makeint.h b/makeint.h index 6d7df4bd..5eb5cb8c 100644 --- a/makeint.h +++ b/makeint.h @@ -485,6 +485,8 @@ void error (const floc *flocp, size_t length, const char *fmt, ...) void fatal (const floc *flocp, size_t length, const char *fmt, ...) __attribute__ ((noreturn, __format__ (__printf__, 3, 4))); +/* When adding macros to this list be sure to update the value of + XGETTEXT_OPTIONS in the po/Makevars file. */ #define O(_t,_a,_f) _t((_a), 0, (_f)) #define OS(_t,_a,_f,_s) _t((_a), strlen (_s), (_f), (_s)) #define OSS(_t,_a,_f,_s1,_s2) _t((_a), strlen (_s1) + strlen (_s2), \ diff --git a/po/Makevars b/po/Makevars index ee018843..e32ea34b 100644 --- a/po/Makevars +++ b/po/Makevars @@ -26,7 +26,13 @@ subdir = po top_builddir = .. # These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ +# Ensure that all our magical output macros are correctly marked as +# C (printf) format strings. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ \ + --flag=DB:2:c-format --flag=DBF:2:c-format --flag=DBS:2:c-format \ + --flag=O:3:c-format --flag=OSN:3:c-format --flag=ONS:3:c-format \ + --flag=OS:3:c-format --flag=OSS:3:c-format --flag=OSSS:3:c-format \ + --flag=ON:3:c-format --flag=ONN:3:c-format # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding