aboutsummaryrefslogtreecommitdiff
path: root/ports/log4cxx/001_msvc.patch
blob: be8742c9b2d97d7dd382ab83640ac6a32f9dbef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
diff --git a/src/main/cpp/locationinfo.cpp b/src/main/cpp/locationinfo.cpp
index e76ea29c..edcc05f5 100644
--- a/src/main/cpp/locationinfo.cpp
+++ b/src/main/cpp/locationinfo.cpp
@@ -148,7 +148,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
     if (lineNumber == -1 && fileName == NA && methodName == NA_METHOD) {
          os.writeNull(p);
     } else {
-        char prolog[] = {
+        uint8_t prolog[] = {
          0x72, 0x00, 0x21, 0x6F, 0x72, 0x67, 0x2E, 
          0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C, 
          0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69, 
@@ -161,7 +161,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
                 0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67, 
                 0x2F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B,
          0x78, 0x70 };
-      os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p);
+      os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, (char *)prolog, sizeof(prolog), p);
         char* line = p.itoa(lineNumber);
         //
         //   construct Java-like fullInfo (replace "::" with ".")
diff --git a/src/main/cpp/loggingevent.cpp b/src/main/cpp/loggingevent.cpp
index 1c0d4be7..ba662147 100644
--- a/src/main/cpp/loggingevent.cpp
+++ b/src/main/cpp/loggingevent.cpp
@@ -236,7 +236,7 @@ void LoggingEvent::setProperty(const LogString& key, const LogString& value)
 
 
 void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p)  {
-     char classDesc[] = {
+     uint8_t classDesc[] = {
         0x72, 0x00, 0x21, 
         0x6F, 0x72, 0x67, 0x2E, 0x61, 0x70, 0x61, 0x63, 
         0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A, 
@@ -292,7 +292,7 @@ void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p)  {
         0x3B, 0x78, 0x70 }; 
 
      os.writeProlog("org.apache.log4j.spi.LoggingEvent", 
-        8, classDesc, sizeof(classDesc), p);
+        8, (char *)classDesc, sizeof(classDesc), p);
 }
 
 void LoggingEvent::write(helpers::ObjectOutputStream& os, Pool& p) const {
diff --git a/src/main/cpp/objectoutputstream.cpp b/src/main/cpp/objectoutputstream.cpp
index 7cd696b8..f80261d9 100644
--- a/src/main/cpp/objectoutputstream.cpp
+++ b/src/main/cpp/objectoutputstream.cpp
@@ -36,8 +36,8 @@ ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p)
        objectHandle(0x7E0000),
        classDescriptions(new ClassDescriptionMap())
 {
-   char start[] = { 0xAC, 0xED, 0x00, 0x05 };
-   ByteBuffer buf(start, sizeof(start));
+   uint8_t start[] = { 0xAC, 0xED, 0x00, 0x05 };
+   ByteBuffer buf((char *)start, sizeof(start));
    os->write(buf, p);
 }
 
@@ -81,7 +81,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
     //
     //  TC_OBJECT and the classDesc for java.util.Hashtable
     //
-    char prolog[] = {
+    uint8_t prolog[] = {
         0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61, 
         0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61, 
         0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13, 
@@ -90,12 +90,12 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
         0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49, 
         0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 
         0x6F, 0x6C, 0x64, 0x78, 0x70  };
-    writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p);
+    writeProlog("java.util.Hashtable", 1, (char *)prolog, sizeof(prolog), p);
     //
     //   loadFactor = 0.75, threshold = 5, blockdata start, buckets.size = 7
-    char data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 
+    uint8_t data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 
         TC_BLOCKDATA, 0x08, 0x00, 0x00, 0x00, 0x07 };
-    ByteBuffer dataBuf(data, sizeof(data));
+    ByteBuffer dataBuf((char *)data, sizeof(data));
     os->write(dataBuf, p);
     char size[4];
     size_t sz = val.size();
diff --git a/src/main/cpp/simpledateformat.cpp b/src/main/cpp/simpledateformat.cpp
index f18dfc75..cbce2db9 100644
--- a/src/main/cpp/simpledateformat.cpp
+++ b/src/main/cpp/simpledateformat.cpp
@@ -126,7 +126,7 @@ namespace log4cxx
                         size_t start = 0;
                         std::basic_ostringstream<wchar_t> os;
                         for(; valueIter != values.end(); valueIter++) {
-                            PUT_FACET(facet, os, &time, (wchar_t) wspec);
+                            PUT_FACET(facet, os, &time, wspec);
                             Transcoder::decode(os.str().substr(start), *valueIter);
                             start = os.str().length();
                             (*inc)(time, aprtime);
diff --git a/src/main/cpp/stringhelper.cpp b/src/main/cpp/stringhelper.cpp
index ca4b1ace..b89dc65d 100644
--- a/src/main/cpp/stringhelper.cpp
+++ b/src/main/cpp/stringhelper.cpp
@@ -21,6 +21,7 @@
 #include <log4cxx/helpers/transcoder.h>
 #include <algorithm>
 #include <vector>
+#include <iterator>
 #include <apr_strings.h>
 #include <log4cxx/helpers/pool.h>
 #if !defined(LOG4CXX)
diff --git a/src/main/include/log4cxx/asyncappender.h b/src/main/include/log4cxx/asyncappender.h
index cbe9b3c7..86a7371c 100644
--- a/src/main/include/log4cxx/asyncappender.h
+++ b/src/main/include/log4cxx/asyncappender.h
@@ -35,6 +35,7 @@
 
 namespace log4cxx
 {
+        LOG4CXX_LIST_DEF(LoggingEventList, log4cxx::spi::LoggingEventPtr);
 
         /**
         The AsyncAppender lets users log events asynchronously. It uses a
@@ -194,7 +195,6 @@ namespace log4cxx
                 /**
                  * Event buffer.
                 */
-                LOG4CXX_LIST_DEF(LoggingEventList, log4cxx::spi::LoggingEventPtr);
                 LoggingEventList buffer;
 
                 /**
diff --git a/src/main/include/log4cxx/helpers/bytearrayinputstream.h b/src/main/include/log4cxx/helpers/bytearrayinputstream.h
index 92bcb595..11d33def 100755
--- a/src/main/include/log4cxx/helpers/bytearrayinputstream.h
+++ b/src/main/include/log4cxx/helpers/bytearrayinputstream.h
@@ -32,6 +32,7 @@ namespace log4cxx
 {
 
         namespace helpers {
+          LOG4CXX_LIST_DEF(ByteList, unsigned char);
 
           /**
            * InputStream implemented on top of a byte array.
@@ -39,7 +40,6 @@ namespace log4cxx
           class LOG4CXX_EXPORT ByteArrayInputStream : public InputStream
           {
           private:
-              LOG4CXX_LIST_DEF(ByteList, unsigned char);
               ByteList buf;
               size_t pos;
 
diff --git a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
index 34e3d095..1f4233da 100644
--- a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
+++ b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
@@ -34,6 +34,7 @@ namespace log4cxx
 
         namespace helpers {
           class Pool;
+          LOG4CXX_LIST_DEF(ByteList, unsigned char);
 
           /**
           *   OutputStream implemented on top of std::vector
@@ -41,7 +42,6 @@ namespace log4cxx
           class LOG4CXX_EXPORT ByteArrayOutputStream : public OutputStream
           {
           private:
-                 LOG4CXX_LIST_DEF(ByteList, unsigned char);
                  ByteList array;
 
           public:
diff --git a/src/main/include/log4cxx/helpers/simpledateformat.h b/src/main/include/log4cxx/helpers/simpledateformat.h
index 9c27f685..0b4dc5fd 100644
--- a/src/main/include/log4cxx/helpers/simpledateformat.h
+++ b/src/main/include/log4cxx/helpers/simpledateformat.h
@@ -39,6 +39,8 @@ namespace log4cxx
             class PatternToken;
         }
 
+          LOG4CXX_LIST_DEF(PatternTokenList, log4cxx::helpers::SimpleDateFormatImpl::PatternToken*);
+
           /**
            * Concrete class for formatting and parsing dates in a
            * locale-sensitive manner.
@@ -75,8 +77,6 @@ namespace log4cxx
                   /**
                    * List of tokens.
                    */
-                  LOG4CXX_LIST_DEF(PatternTokenList, log4cxx::helpers::SimpleDateFormatImpl::PatternToken*);
-
                   PatternTokenList pattern;
                   
                   static void addToken(const logchar spec, const int repeat, const std::locale* locale, PatternTokenList& pattern);
diff --git a/src/main/include/log4cxx/helpers/socketoutputstream.h b/src/main/include/log4cxx/helpers/socketoutputstream.h
index 6bca1733..0c6fbb4f 100644
--- a/src/main/include/log4cxx/helpers/socketoutputstream.h
+++ b/src/main/include/log4cxx/helpers/socketoutputstream.h
@@ -32,6 +32,7 @@ namespace log4cxx
 {
         namespace helpers
         {
+                LOG4CXX_LIST_DEF(ByteList, unsigned char);
 
                 class LOG4CXX_EXPORT SocketOutputStream : public OutputStream
                 {
@@ -50,7 +51,6 @@ namespace log4cxx
                         virtual void write(ByteBuffer& buf, Pool& p);
 
                 private:
-                        LOG4CXX_LIST_DEF(ByteList, unsigned char);
                         ByteList array;
                         SocketPtr socket;
                        //
diff --git a/src/main/include/log4cxx/net/sockethubappender.h b/src/main/include/log4cxx/net/sockethubappender.h
index 89948334..b4269943 100644
--- a/src/main/include/log4cxx/net/sockethubappender.h
+++ b/src/main/include/log4cxx/net/sockethubappender.h
@@ -38,6 +38,8 @@ namespace log4cxx
         }
         namespace net
         {
+                LOG4CXX_LIST_DEF(ObjectOutputStreamList, log4cxx::helpers::ObjectOutputStreamPtr);
+
                 /**
                 Sends {@link log4cxx::spi::LoggingEvent LoggingEvent} objects to a set of remote log
                 servers, usually a SocketNode.
@@ -112,7 +114,6 @@ namespace log4cxx
                         static int DEFAULT_PORT;
 
                         int port;
-                        LOG4CXX_LIST_DEF(ObjectOutputStreamList, log4cxx::helpers::ObjectOutputStreamPtr);
                         ObjectOutputStreamList streams;
                         bool locationInfo;
 
diff --git a/src/main/include/log4cxx/net/telnetappender.h b/src/main/include/log4cxx/net/telnetappender.h
index 5cbe2b0b..17678d86 100644
--- a/src/main/include/log4cxx/net/telnetappender.h
+++ b/src/main/include/log4cxx/net/telnetappender.h
@@ -39,6 +39,8 @@ namespace log4cxx
         }
         namespace net
         {
+                typedef log4cxx::helpers::SocketPtr Connection;
+                LOG4CXX_LIST_DEF(ConnectionList, Connection);
 /**
 <p>The TelnetAppender is a log4cxx appender that specializes in
 writing to a read-only socket.  The output is provided in a
@@ -131,9 +133,6 @@ servlet.
                         TelnetAppender(const TelnetAppender&);
                         TelnetAppender& operator=(const TelnetAppender&);
 
-                        typedef log4cxx::helpers::SocketPtr Connection;
-                        LOG4CXX_LIST_DEF(ConnectionList, Connection);
-                        
                         void write(log4cxx::helpers::ByteBuffer&);
                         void writeStatus(const log4cxx::helpers::SocketPtr& socket, const LogString& msg, log4cxx::helpers::Pool& p);
                         ConnectionList connections;
diff --git a/src/main/include/log4cxx/patternlayout.h b/src/main/include/log4cxx/patternlayout.h
index 55d6eb5b..d084b6cb 100644
--- a/src/main/include/log4cxx/patternlayout.h
+++ b/src/main/include/log4cxx/patternlayout.h
@@ -32,6 +32,8 @@
 
 namespace log4cxx
 {
+        LOG4CXX_LIST_DEF(LoggingEventPatternConverterList, log4cxx::pattern::LoggingEventPatternConverterPtr);
+        LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
 
         /**
 
@@ -334,13 +336,11 @@ namespace log4cxx
                 /**
                  * Pattern converters.
                  */
-                LOG4CXX_LIST_DEF(LoggingEventPatternConverterList, log4cxx::pattern::LoggingEventPatternConverterPtr);
                 LoggingEventPatternConverterList patternConverters;
 
                /**
                 * Field widths and alignment corresponding to pattern converters.
                 */
-                LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
                 FormattingInfoList patternFields;
 
 
diff --git a/src/main/include/log4cxx/rolling/rollingpolicybase.h b/src/main/include/log4cxx/rolling/rollingpolicybase.h
index 154b17d9..ab8dad70 100755
--- a/src/main/include/log4cxx/rolling/rollingpolicybase.h
+++ b/src/main/include/log4cxx/rolling/rollingpolicybase.h
@@ -34,6 +34,8 @@
 
 namespace log4cxx {
     namespace rolling {
+        LOG4CXX_LIST_DEF(PatternConverterList, log4cxx::pattern::PatternConverterPtr);
+        LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
 
         /**
          * Implements methods common to most, it not all, rolling
@@ -57,13 +59,11 @@ namespace log4cxx {
           /**
            * File name pattern converters.
            */
-          LOG4CXX_LIST_DEF(PatternConverterList, log4cxx::pattern::PatternConverterPtr);
           PatternConverterList patternConverters;
 
           /**
            * File name field specifiers.
            */
-          LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
           FormattingInfoList patternFields;
 
           /**
diff --git a/src/main/include/log4cxx/spi/loggingevent.h b/src/main/include/log4cxx/spi/loggingevent.h
index 25f5c0dd..102bea21 100644
--- a/src/main/include/log4cxx/spi/loggingevent.h
+++ b/src/main/include/log4cxx/spi/loggingevent.h
@@ -43,6 +43,7 @@ namespace log4cxx
 
         namespace spi
         {
+                LOG4CXX_LIST_DEF(KeySet, LogString);
 
                 /**
                 The internal representation of logging events. When an affirmative
@@ -152,7 +153,6 @@ namespace log4cxx
                         */
                         bool getMDC(const LogString& key, LogString& dest) const;
 
-                        LOG4CXX_LIST_DEF(KeySet, LogString);
                         /**
                         * Returns the set of of the key values in the MDC for the event.
                         * The returned set is unmodifiable by the caller.
@@ -160,6 +160,7 @@ namespace log4cxx
                         * @return Set an unmodifiable set of the MDC keys.
                         * 
                         */
+                        typedef spi::KeySet KeySet;
                         KeySet getMDCKeySet() const;
 
                         /**