0001-patch-configs.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. From f74866358fc0b8e7b77c4603a4dd70b09e6ccbbd Mon Sep 17 00:00:00 2001
  2. From: mcrouse <mcrouse@google.com>
  3. Date: Fri, 5 Feb 2021 16:20:25 +0000
  4. Subject: [PATCH] patch configs for windows
  5. ---
  6. third_party/libzip/src/config.h | 18 ++++++++++++++++--
  7. third_party/libzip/src/zipconf.h | 12 ++++++++++--
  8. 2 files changed, 26 insertions(+), 4 deletions(-)
  9. diff --git a/third_party/libzip/src/config.h b/third_party/libzip/src/config.h
  10. index 536e20b32e6f..15dfff401971 100644
  11. --- a/third_party/libzip/src/config.h
  12. +++ b/third_party/libzip/src/config.h
  13. @@ -3,6 +3,9 @@
  14. #ifndef _HAD_ZIPCONF_H
  15. #include "zipconf.h"
  16. #endif
  17. +
  18. +#include "build/build_config.h"
  19. +
  20. /* BEGIN DEFINES */
  21. /* #undef HAVE___PROGNAME */
  22. /* #undef HAVE__CLOSE */
  23. @@ -23,28 +26,39 @@
  24. /* #undef HAVE_CRYPTO */
  25. /* #undef HAVE_FICLONERANGE */
  26. #define HAVE_FILENO
  27. +#if !defined(OS_WIN)
  28. #define HAVE_FSEEKO
  29. #define HAVE_FTELLO
  30. +#endif
  31. /* #undef HAVE_GETPROGNAME */
  32. /* #undef HAVE_GNUTLS */
  33. /* #undef HAVE_LIBBZ2 */
  34. /* #undef HAVE_LIBLZMA */
  35. +/* #undef HAVE_LOCALTIME_R */
  36. +#if !defined(OS_WIN)
  37. #define HAVE_LOCALTIME_R
  38. +#endif
  39. /* #undef HAVE_MBEDTLS */
  40. /* #undef HAVE_MKSTEMP */
  41. /* #undef HAVE_NULLABLE */
  42. /* #undef HAVE_OPENSSL */
  43. /* #undef HAVE_SETMODE */
  44. #define HAVE_SNPRINTF
  45. +#if !defined(OS_WIN)
  46. #define HAVE_STRCASECMP
  47. +#endif
  48. #define HAVE_STRDUP
  49. -/* #undef HAVE_STRICMP */
  50. +#if defined(OS_WIN)
  51. +#define HAVE_STRICMP
  52. +#endif
  53. #define HAVE_STRTOLL
  54. #define HAVE_STRTOULL
  55. /* #undef HAVE_STRUCT_TM_TM_ZONE */
  56. #define HAVE_STDBOOL_H
  57. +#if !defined(OS_WIN)
  58. #define HAVE_STRINGS_H
  59. #define HAVE_UNISTD_H
  60. +#endif
  61. /* #undef HAVE_WINDOWS_CRYPTO */
  62. #define SIZEOF_OFF_T 8
  63. #define SIZEOF_SIZE_T 8
  64. @@ -59,4 +73,4 @@
  65. #define PACKAGE "libzip"
  66. #define VERSION "1.7.3"
  67. -#endif /* HAD_CONFIG_H */
  68. \ No newline at end of file
  69. +#endif /* HAD_CONFIG_H */
  70. diff --git a/third_party/libzip/src/zipconf.h b/third_party/libzip/src/zipconf.h
  71. index 4db748234649..f79875034709 100644
  72. --- a/third_party/libzip/src/zipconf.h
  73. +++ b/third_party/libzip/src/zipconf.h
  74. @@ -8,12 +8,16 @@
  75. based on ../cmake-zipconf.h.in.
  76. */
  77. +#include "build/build_config.h"
  78. +
  79. #define LIBZIP_VERSION "1.7.3"
  80. #define LIBZIP_VERSION_MAJOR 1
  81. #define LIBZIP_VERSION_MINOR 7
  82. #define LIBZIP_VERSION_MICRO 3
  83. -/* #undef ZIP_STATIC */
  84. +#define ZIP_STATIC
  85. #define _Nullable
  86. #define _Nonnull
  87. @@ -32,6 +36,10 @@ typedef uint32_t zip_uint32_t;
  88. typedef int64_t zip_int64_t;
  89. typedef uint64_t zip_uint64_t;
  90. +#if defined(OS_WIN)
  91. +typedef int mode_t;
  92. +#endif
  93. +
  94. #define ZIP_INT8_MIN (-ZIP_INT8_MAX - 1)
  95. #define ZIP_INT8_MAX 0x7f
  96. #define ZIP_UINT8_MAX 0xff
  97. @@ -48,4 +56,4 @@ typedef uint64_t zip_uint64_t;
  98. #define ZIP_INT64_MAX 0x7fffffffffffffffLL
  99. #define ZIP_UINT64_MAX 0xffffffffffffffffULL
  100. -#endif /* zipconf.h */
  101. \ No newline at end of file
  102. +#endif /* zipconf.h */
  103. --
  104. 2.30.0.365.g02bc693789-goog