Apply and update 04-gcc-specify-printf-format.diff

remotes/origin/textfind-and-transparency
Albert Astals Cid 15 years ago
parent 5c2bb74538
commit 34a2f4605a
  1. 18
      generators/poppler/synctex/patches/04-gcc-specify-printf-format.diff
  2. 8
      generators/poppler/synctex/synctex_parser_utils.h

@ -1,11 +1,13 @@
Index: synctex/synctex_parser_utils.h diff --git a/generators/poppler/synctex/synctex_parser_utils.h b/generators/poppler/synctex/synctex_parser_utils.h
=================================================================== index f0709e9..92184b8 100644
--- synctex.orig/synctex_parser_utils.h 2010-05-23 19:07:34.000000000 +0200 --- a/generators/poppler/synctex/synctex_parser_utils.h
+++ synctex/synctex_parser_utils.h 2010-05-23 19:08:00.000000000 +0200 +++ b/generators/poppler/synctex/synctex_parser_utils.h
@@ -61,6 +61,12 @@ @@ -72,7 +72,13 @@ extern "C" {
# define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c) # else
# define SYNCTEX_IS_DOT(c) ('.' == c)
# endif # endif
-
+
+# ifdef __GNUC__ +# ifdef __GNUC__
+# define SYNCTEX_PRINTF_FORMAT(si, ftc) __attribute__ ((format (printf, si, ftc))) +# define SYNCTEX_PRINTF_FORMAT(si, ftc) __attribute__ ((format (printf, si, ftc)))
+# else +# else
@ -15,7 +17,7 @@ Index: synctex/synctex_parser_utils.h
/* This custom malloc functions initializes to 0 the newly allocated memory. /* This custom malloc functions initializes to 0 the newly allocated memory.
* There is no bzero function on windows. */ * There is no bzero function on windows. */
void *_synctex_malloc(size_t size); void *_synctex_malloc(size_t size);
@@ -68,7 +74,7 @@ @@ -80,7 +86,7 @@ void *_synctex_malloc(size_t size);
/* This is used to log some informational message to the standard error stream. /* This is used to log some informational message to the standard error stream.
* On Windows, the stderr stream is not exposed and another method is used. * On Windows, the stderr stream is not exposed and another method is used.
* The return value is the number of characters printed. */ * The return value is the number of characters printed. */

@ -73,6 +73,12 @@ extern "C" {
# define SYNCTEX_IS_DOT(c) ('.' == c) # define SYNCTEX_IS_DOT(c) ('.' == c)
# endif # endif
# ifdef __GNUC__
# define SYNCTEX_PRINTF_FORMAT(si, ftc) __attribute__ ((format (printf, si, ftc)))
# else
# define SYNCTEX_PRINTF_FORMAT(si, ftc)
# endif
/* This custom malloc functions initializes to 0 the newly allocated memory. /* This custom malloc functions initializes to 0 the newly allocated memory.
* There is no bzero function on windows. */ * There is no bzero function on windows. */
void *_synctex_malloc(size_t size); void *_synctex_malloc(size_t size);
@ -80,7 +86,7 @@ void *_synctex_malloc(size_t size);
/* This is used to log some informational message to the standard error stream. /* This is used to log some informational message to the standard error stream.
* On Windows, the stderr stream is not exposed and another method is used. * On Windows, the stderr stream is not exposed and another method is used.
* The return value is the number of characters printed. */ * The return value is the number of characters printed. */
int _synctex_error(const char * reason,...); int _synctex_error(const char * reason,...) SYNCTEX_PRINTF_FORMAT(1, 2);
/* strip the last extension of the given string, this string is modified! /* strip the last extension of the given string, this string is modified!
* This function depends on the OS because the path separator may differ. * This function depends on the OS because the path separator may differ.

Loading…
Cancel
Save