git-uclibc.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. From 59c678a754227ca1fb44541cdfe39bbe052be195 Mon Sep 17 00:00:00 2001
  2. From: Natanael Copa <ncopa@alpinelinux.org>
  3. Date: Tue, 27 Aug 2013 07:57:12 +0000
  4. Subject: [PATCH] config: add _cb suffix to callback functions
  5. Commit 4d8dd1494e9f3af2e9738edaca40ada096f7bf10 introduced a build
  6. regression on uClibc which defines fgetc as macro. To work around that
  7. we add a _cb suffix to the callback functions.
  8. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
  9. ---
  10. config.c | 32 ++++++++++++++++----------------
  11. 1 file changed, 16 insertions(+), 16 deletions(-)
  12. diff --git a/config.c b/config.c
  13. index e13a7b6..aa80078 100644
  14. --- a/config.c
  15. +++ b/config.c
  16. @@ -27,9 +27,9 @@ struct config_source {
  17. struct strbuf value;
  18. struct strbuf var;
  19. - int (*fgetc)(struct config_source *c);
  20. - int (*ungetc)(int c, struct config_source *conf);
  21. - long (*ftell)(struct config_source *c);
  22. + int (*fgetc_cb)(struct config_source *c);
  23. + int (*ungetc_cb)(int c, struct config_source *conf);
  24. + long (*ftell_cb)(struct config_source *c);
  25. };
  26. static struct config_source *cf;
  27. @@ -217,13 +217,13 @@ int git_config_from_parameters(config_fn_t fn, void *data)
  28. static int get_next_char(void)
  29. {
  30. - int c = cf->fgetc(cf);
  31. + int c = cf->fgetc_cb(cf);
  32. if (c == '\r') {
  33. /* DOS like systems */
  34. - c = cf->fgetc(cf);
  35. + c = cf->fgetc_cb(cf);
  36. if (c != '\n') {
  37. - cf->ungetc(c, cf);
  38. + cf->ungetc_cb(c, cf);
  39. c = '\r';
  40. }
  41. }
  42. @@ -992,9 +992,9 @@ int git_config_from_file(config_fn_t fn, const char *filename, void *data)
  43. top.u.file = f;
  44. top.name = filename;
  45. top.die_on_error = 1;
  46. - top.fgetc = config_file_fgetc;
  47. - top.ungetc = config_file_ungetc;
  48. - top.ftell = config_file_ftell;
  49. + top.fgetc_cb = config_file_fgetc;
  50. + top.ungetc_cb = config_file_ungetc;
  51. + top.ftell_cb = config_file_ftell;
  52. ret = do_config_from(&top, fn, data);
  53. @@ -1013,9 +1013,9 @@ int git_config_from_buf(config_fn_t fn, const char *name, const char *buf,
  54. top.u.buf.pos = 0;
  55. top.name = name;
  56. top.die_on_error = 0;
  57. - top.fgetc = config_buf_fgetc;
  58. - top.ungetc = config_buf_ungetc;
  59. - top.ftell = config_buf_ftell;
  60. + top.fgetc_cb = config_buf_fgetc;
  61. + top.ungetc_cb = config_buf_ungetc;
  62. + top.ftell_cb = config_buf_ftell;
  63. return do_config_from(&top, fn, data);
  64. }
  65. @@ -1196,7 +1196,7 @@ static int store_aux(const char *key, const char *value, void *cb)
  66. return 1;
  67. }
  68. - store.offset[store.seen] = cf->ftell(cf);
  69. + store.offset[store.seen] = cf->ftell_cb(cf);
  70. store.seen++;
  71. }
  72. break;
  73. @@ -1223,19 +1223,19 @@ static int store_aux(const char *key, const char *value, void *cb)
  74. * Do not increment matches: this is no match, but we
  75. * just made sure we are in the desired section.
  76. */
  77. - store.offset[store.seen] = cf->ftell(cf);
  78. + store.offset[store.seen] = cf->ftell_cb(cf);
  79. /* fallthru */
  80. case SECTION_END_SEEN:
  81. case START:
  82. if (matches(key, value)) {
  83. - store.offset[store.seen] = cf->ftell(cf);
  84. + store.offset[store.seen] = cf->ftell_cb(cf);
  85. store.state = KEY_SEEN;
  86. store.seen++;
  87. } else {
  88. if (strrchr(key, '.') - key == store.baselen &&
  89. !strncmp(key, store.key, store.baselen)) {
  90. store.state = SECTION_SEEN;
  91. - store.offset[store.seen] = cf->ftell(cf);
  92. + store.offset[store.seen] = cf->ftell_cb(cf);
  93. }
  94. }
  95. }
  96. --
  97. 1.8.3.4