Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / external / gpgmepp / w32-fix-win32-macro.patch.1
blob70a8b5ffe6e833e5a86844f9f07f0b7604c1636c
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,10 +33,16 @@
107  #include <gpgme.h>
109  #include <string.h>
110 +#if HAVE_STRINGS_H
111  #include <strings.h>
112 +#endif
113  #include <istream>
114  #include <iterator>
116 +#ifdef _MSC_VER
117 +#  define strcasecmp _stricmp
118 +#endif
120  const GpgME::Key::Null GpgME::Key::null;
122  namespace GpgME
123 diff -ur gpgmepp.org/lang/cpp/src/key.h gpgmepp/lang/cpp/src/key.h
124 --- gpgmepp.org/lang/cpp/src/key.h      2017-03-20 20:10:15.000000000 +0100
125 +++ gpgmepp/lang/cpp/src/key.h  2017-11-20 17:07:51.551632000 +0100
126 @@ -30,7 +30,6 @@
127  #include "gpgmefw.h"
129  #include <memory>
130 -#include <sys/time.h>
132  #include <vector>
133  #include <algorithm>
134 diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_export.h
135 --- gpgmepp.org/lang/qt/src/qgpgme_export.h     2016-11-03 17:32:30.000000000 +0100
136 +++ gpgmepp/lang/qt/src/qgpgme_export.h 2017-11-20 16:58:27.395388000 +0100
137 @@ -39,14 +39,14 @@
138  #  ifndef QGPGME_EXPORT
139  #    ifdef BUILDING_QGPGME
140          /* We are building this library */
141 -#      ifdef WIN32
142 +#      ifdef _WIN32
143  #       define QGPGME_EXPORT __declspec(dllexport)
144  #      else
145  #       define QGPGME_EXPORT __attribute__((visibility("default")))
146  #      endif
147  #    else
148          /* We are using this library */
149 -#      ifdef WIN32
150 +#      ifdef _WIN32
151  #       define QGPGME_EXPORT __declspec(dllimport)
152  #      else
153  #       define QGPGME_EXPORT __attribute__((visibility("default")))
154 @@ -55,7 +55,7 @@
155  #  endif
157  #  ifndef QGPGME_NO_EXPORT
158 -#    ifdef WIN32
159 +#    ifdef _WIN32
160  #     define QGPGME_NO_EXPORT
161  #    else
162  #     define QGPGME_NO_EXPORT __attribute__((visibility("hidden")))
163 @@ -64,7 +64,11 @@
164  #endif
166  #ifndef QGPGME_DEPRECATED
167 -#  define QGPGME_DEPRECATED __attribute__ ((__deprecated__))
168 +#  ifdef _MSC_VER
169 +#    define QGPGME_DEPRECATED __declspec(deprecated("deprecated"))
170 +#  else
171 +#    define QGPGME_DEPRECATED __attribute__ ((__deprecated__))
172 +#  endif
173  #endif
175  #ifndef QGPGME_DEPRECATED_EXPORT