cid#1507934 Big parameter passed by value
[LibreOffice.git] / external / gpgmepp / w32-fix-win32-macro.patch.1
blob66e9ac48099a0cfe81e8d668c9c893decd972fcb
1 diff -ur gpgmepp.org/lang/cpp/src/callbacks.cpp gpgmepp/lang/cpp/src/callbacks.cpp
2 --- gpgmepp.org/lang/cpp/src/callbacks.cpp      2016-10-18 19:22:02.000000000 +0200
3 +++ gpgmepp/lang/cpp/src/callbacks.cpp  2017-11-20 18:03:04.290060900 +0100
4 @@ -38,7 +38,9 @@
5  #include <cassert>
6  #include <cerrno>
7  #include <cstring>
8 +#if HAVE_UNISTD_H
9  #include <unistd.h>
10 +#endif
11  #include <stdlib.h>
13  static inline gpgme_error_t make_err_from_syserror()
14 diff -ur gpgmepp.org/lang/cpp/src/data.h gpgmepp/lang/cpp/src/data.h
15 --- gpgmepp.org/lang/cpp/src/data.h     2017-03-24 15:20:32.000000000 +0100
16 +++ gpgmepp/lang/cpp/src/data.h 2017-11-20 17:23:24.802711200 +0100
17 @@ -31,6 +31,11 @@
18  #include <algorithm>
19  #include <memory>
21 +#ifdef _MSC_VER
22 +#  include <BaseTsd.h>
23 +typedef SSIZE_T ssize_t;
24 +#endif
26  namespace GpgME
27  {
29 diff -ur gpgmepp.org/lang/cpp/src/editinteractor.cpp gpgmepp/lang/cpp/src/editinteractor.cpp
30 --- gpgmepp.org/lang/cpp/src/editinteractor.cpp 2017-03-09 09:01:10.000000000 +0100
31 +++ gpgmepp/lang/cpp/src/editinteractor.cpp     2017-11-20 18:09:33.022674700 +0100
32 @@ -30,9 +30,11 @@
34  #include <gpgme.h>
36 -#ifdef _WIN32
37 +#ifdef _MSC_VER
38  # include <io.h>
39 -#include <windows.h>
40 +# include <windows.h>
41 +# include <BaseTsd.h>
42 +  typedef SSIZE_T ssize_t;
43  #else
44  # include <unistd.h>
45  #endif
46 diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_export.h
47 --- gpgmepp.org/lang/cpp/src/gpgmepp_export.h   2016-08-04 15:03:09.000000000 +0200
48 +++ gpgmepp/lang/cpp/src/gpgmepp_export.h       2017-11-20 16:57:47.805691100 +0100
49 @@ -29,14 +29,14 @@
50  #  ifndef GPGMEPP_EXPORT
51  #    ifdef BUILDING_GPGMEPP
52          /* We are building this library */
53 -#      ifdef WIN32
54 +#      ifdef _MSC_VER
55  #       define GPGMEPP_EXPORT __declspec(dllexport)
56  #      else
57  #       define GPGMEPP_EXPORT __attribute__((visibility("default")))
58  #      endif
59  #    else
60          /* We are using this library */
61 -#      ifdef WIN32
62 +#      ifdef _MSC_VER
63  #       define GPGMEPP_EXPORT __declspec(dllimport)
64  #      else
65  #       define GPGMEPP_EXPORT __attribute__((visibility("default")))
66 @@ -45,7 +45,7 @@
67  #  endif
69  #  ifndef GPGMEPP_NO_EXPORT
70 -#    ifdef WIN32
71 +#    ifdef _MSC_VER
72  #     define GPGMEPP_NO_EXPORT
73  #    else
74  #     define GPGMEPP_NO_EXPORT __attribute__((visibility("hidden")))
75 @@ -54,7 +54,11 @@
76  #endif
78  #ifndef GPGMEPP_DEPRECATED
79 -#  define GPGMEPP_DEPRECATED __attribute__ ((__deprecated__))
80 +#  ifdef _MSC_VER
81 +#    define GPGMEPP_DEPRECATED __declspec(deprecated("deprecated"))
82 +#  else
83 +#    define GPGMEPP_DEPRECATED __attribute__ ((__deprecated__))
84 +#  endif
85  #endif
87  #ifndef GPGMEPP_DEPRECATED_EXPORT
88 diff -ur gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h gpgmepp/lang/cpp/src/interfaces/dataprovider.h
89 --- gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h  2016-05-17 14:32:37.000000000 +0200
90 +++ gpgmepp/lang/cpp/src/interfaces/dataprovider.h      2017-11-20 18:03:11.332715700 +0100
91 @@ -29,6 +29,11 @@
93  #include <gpg-error.h>
95 +#ifdef _MSC_VER
96 +#  include <BaseTsd.h>
97 +typedef SSIZE_T ssize_t;
98 +#endif
100  namespace GpgME
103 diff -ur gpgmepp.org/lang/cpp/src/key.cpp gpgmepp/lang/cpp/src/key.cpp
104 --- gpgmepp.org/lang/cpp/src/key.cpp    2017-03-20 20:10:15.000000000 +0100
105 +++ gpgmepp/lang/cpp/src/key.cpp        2017-11-20 17:44:50.321858800 +0100
106 @@ -33,11 +33,17 @@
107  #include <gpgme.h>
109  #include <string.h>
110 +#if HAVE_STRINGS_H
111  #include <strings.h>
112 +#endif
113  #include <cassert>
114  #include <istream>
115  #include <iterator>
117 +#ifdef _MSC_VER
118 +#  define strcasecmp _stricmp
119 +#endif
121  const GpgME::Key::Null GpgME::Key::null;
123  namespace GpgME
124 diff -ur gpgmepp.org/lang/cpp/src/key.h gpgmepp/lang/cpp/src/key.h
125 --- gpgmepp.org/lang/cpp/src/key.h      2017-03-20 20:10:15.000000000 +0100
126 +++ gpgmepp/lang/cpp/src/key.h  2017-11-20 17:07:51.551632000 +0100
127 @@ -30,7 +30,6 @@
128  #include "gpgmefw.h"
130  #include <memory>
131 -#include <sys/time.h>
133  #include <vector>
134  #include <algorithm>
135 diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_export.h
136 --- gpgmepp.org/lang/qt/src/qgpgme_export.h     2016-11-03 17:32:30.000000000 +0100
137 +++ gpgmepp/lang/qt/src/qgpgme_export.h 2017-11-20 16:58:27.395388000 +0100
138 @@ -39,14 +39,14 @@
139  #  ifndef QGPGME_EXPORT
140  #    ifdef BUILDING_QGPGME
141          /* We are building this library */
142 -#      ifdef WIN32
143 +#      ifdef _WIN32
144  #       define QGPGME_EXPORT __declspec(dllexport)
145  #      else
146  #       define QGPGME_EXPORT __attribute__((visibility("default")))
147  #      endif
148  #    else
149          /* We are using this library */
150 -#      ifdef WIN32
151 +#      ifdef _WIN32
152  #       define QGPGME_EXPORT __declspec(dllimport)
153  #      else
154  #       define QGPGME_EXPORT __attribute__((visibility("default")))
155 @@ -55,7 +55,7 @@
156  #  endif
158  #  ifndef QGPGME_NO_EXPORT
159 -#    ifdef WIN32
160 +#    ifdef _WIN32
161  #     define QGPGME_NO_EXPORT
162  #    else
163  #     define QGPGME_NO_EXPORT __attribute__((visibility("hidden")))
164 @@ -64,7 +64,11 @@
165  #endif
167  #ifndef QGPGME_DEPRECATED
168 -#  define QGPGME_DEPRECATED __attribute__ ((__deprecated__))
169 +#  ifdef _MSC_VER
170 +#    define QGPGME_DEPRECATED __declspec(deprecated("deprecated"))
171 +#  else
172 +#    define QGPGME_DEPRECATED __attribute__ ((__deprecated__))
173 +#  endif
174  #endif
176  #ifndef QGPGME_DEPRECATED_EXPORT