Fix printf-related compilation warnings on MinGW
* src/conf_post.h (ATTRIBUTE_FORMAT_PRINTF) [__MINGW32__]: Use '__ms_printf__', not '__gnu_printf__', as the latter is not what MS 'printf' supports, and causes bogus compilation warnings. * src/lisp.h (pI) [__MINGW32__]: Define to "I64", as MS 'printf' doesn't support the "ll" modifier.
This commit is contained in:
parent
5932ffcd02
commit
643e0b8d28
2 changed files with 14 additions and 5 deletions
|
@ -252,12 +252,17 @@ extern int emacs_setenv_TZ (char const *);
|
|||
#endif
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
|
||||
# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
|
||||
ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
|
||||
#else
|
||||
# ifdef __MINGW32__
|
||||
# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
|
||||
ATTRIBUTE_FORMAT ((__ms_printf__, formatstring_parameter, first_argument))
|
||||
#else /* !__MINGW32__ */
|
||||
# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
|
||||
ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
|
||||
#endif /* !__MINGW32__ */
|
||||
#else /* __GNUC__ < 4.4 */
|
||||
# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
|
||||
ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
|
||||
#endif
|
||||
#endif /* __GNUC__ < 4.4 */
|
||||
|
||||
#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
|
||||
#define ATTRIBUTE_UNUSED _GL_UNUSED
|
||||
|
|
|
@ -88,7 +88,11 @@ typedef unsigned long EMACS_UINT;
|
|||
typedef long long int EMACS_INT;
|
||||
typedef unsigned long long int EMACS_UINT;
|
||||
# define EMACS_INT_MAX LLONG_MAX
|
||||
# define pI "ll"
|
||||
# ifdef __MINGW32__
|
||||
# define pI "I64"
|
||||
# else
|
||||
# define pI "ll"
|
||||
# endif
|
||||
# else
|
||||
# error "INTPTR_MAX too large"
|
||||
# endif
|
||||
|
|
Loading…
Add table
Reference in a new issue