Skip to content

Commit 235c0eb

Browse files
committed
Native Win32 (VS) support (take one)
1 parent 7d204c7 commit 235c0eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4011
-2073
lines changed

LICENCES.rtf

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}{\f1\fnil\fcharset0 Calibri;}}
2+
{\colortbl ;\red0\green0\blue255;}
3+
{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\lang1053\f0\fs22 librdkafka - Apache Kafka C driver library\par
4+
\par
5+
Copyright (c) 2012-2015, Magnus Edenhill\par
6+
All rights reserved.\par
7+
\par
8+
Redistribution and use in source and binary forms, with or without\par
9+
modification, are permitted provided that the following conditions are met: \par
10+
\par
11+
1. Redistributions of source code must retain the above copyright notice,\par
12+
this list of conditions and the following disclaimer. \par
13+
2. Redistributions in binary form must reproduce the above copyright notice,\par
14+
this list of conditions and the following disclaimer in the documentation\par
15+
and/or other materials provided with the distribution. \par
16+
\par
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\par
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \par
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE \par
20+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \par
21+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \par
22+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \par
23+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \par
24+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \par
25+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\par
26+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\par
27+
POSSIBILITY OF SUCH DAMAGE.\par
28+
\par
29+
\par
30+
\par
31+
#######################################################################\par
32+
# The following license applies to the files rdcrc32.c and rdcrc32.h #\par
33+
# which have been generated by the pycrc tool. #\par
34+
#######################################################################\par
35+
\par
36+
Copyright (c) 2006-2012, Thomas Pircher <[email protected]>\par
37+
\par
38+
Permission is hereby granted, free of charge, to any person obtaining a copy\par
39+
of this software and associated documentation files (the "Software"), to deal\par
40+
in the Software without restriction, including without limitation the rights\par
41+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\par
42+
copies of the Software, and to permit persons to whom the Software is\par
43+
furnished to do so, subject to the following conditions:\par
44+
\par
45+
The above copyright notice and this permission notice shall be included in\par
46+
all copies or substantial portions of the Software.\par
47+
\par
48+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\par
49+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\par
50+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\par
51+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\par
52+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\par
53+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\par
54+
THE SOFTWARE.\par
55+
\pard\sa200\sl276\slmult1\lang29\f1\par
56+
\par
57+
\pard\lang1053\f0 ######################################################################\par
58+
# LICENSE.snappy covers files: snappy.c, snappy.h, snappy_compat.h #\par
59+
# originally retrieved from {\field{\*\fldinst{HYPERLINK "http://github.com/andikleen/snappy-c"}}{\fldrslt{\ul\cf1 http://github.com/andikleen/snappy-c}}}\f0\fs22 #\par
60+
# git revision 711c52b7ef94c8e5c600571987fbe5769070b884\tab #\par
61+
######################################################################\par
62+
\par
63+
The snappy-c code is under the same license as the original snappy source\par
64+
\par
65+
Copyright 2011 Intel Corporation All Rights Reserved.\par
66+
\par
67+
Redistribution and use in source and binary forms, with or without\par
68+
modification, are permitted provided that the following conditions are\par
69+
met:\par
70+
\par
71+
* Redistributions of source code must retain the above copyright\par
72+
notice, this list of conditions and the following disclaimer.\par
73+
* Redistributions in binary form must reproduce the above\par
74+
copyright notice, this list of conditions and the following disclaimer\par
75+
in the documentation and/or other materials provided with the\par
76+
distribution.\par
77+
* Neither the name of Intel Corporation nor the names of its\par
78+
contributors may be used to endorse or promote products derived from\par
79+
this software without specific prior written permission.\par
80+
\par
81+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\par
82+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\par
83+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\par
84+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\par
85+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\par
86+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\par
87+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\par
88+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\par
89+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\par
90+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\par
91+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\par
92+
\par
93+
\par
94+
######################################################################\par
95+
# tinycthread.c and tinycthread.h #\par
96+
######################################################################\par
97+
From {\field{\*\fldinst{HYPERLINK "https://github.com/tinycthread/tinycthread/README.txt"}}{\fldrslt{\ul\cf1 https://github.com/tinycthread/tinycthread/README.txt}}}\f0\fs22 c57166cd510ffb5022dd5f127489b131b61441b9\par
98+
\par
99+
License\par
100+
-------\par
101+
\par
102+
Copyright (c) 2012 Marcus Geelnard\par
103+
2013-2014 Evan Nemerson\par
104+
\par
105+
This software is provided 'as-is', without any express or implied\par
106+
warranty. In no event will the authors be held liable for any damages\par
107+
arising from the use of this software.\par
108+
\par
109+
Permission is granted to anyone to use this software for any purpose,\par
110+
including commercial applications, and to alter it and redistribute it\par
111+
freely, subject to the following restrictions:\par
112+
\par
113+
1. The origin of this software must not be misrepresented; you must not\par
114+
claim that you wrote the original software. If you use this software\par
115+
in a product, an acknowledgment in the product documentation would be\par
116+
appreciated but is not required.\par
117+
\par
118+
2. Altered source versions must be plainly marked as such, and must not be\par
119+
misrepresented as being the original software.\par
120+
\par
121+
3. This notice may not be removed or altered from any source\par
122+
distribution.\par
123+
\par
124+
\par
125+
\par
126+
################################################################\par
127+
# For the files wingetopt.c wingetopt.h downloaded from\par
128+
# {\field{\*\fldinst{HYPERLINK "https://github.com/alex85k/wingetopt"}}{\fldrslt{\ul\cf1 https://github.com/alex85k/wingetopt}}}\f0\fs22\par
129+
################################################################\par
130+
\par
131+
\par
132+
/*\par
133+
* Copyright (c) 2002 Todd C. Miller <[email protected]>\par
134+
*\par
135+
* Permission to use, copy, modify, and distribute this software for any\par
136+
* purpose with or without fee is hereby granted, provided that the above\par
137+
* copyright notice and this permission notice appear in all copies.\par
138+
*\par
139+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\par
140+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\par
141+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\par
142+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\par
143+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\par
144+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\par
145+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\par
146+
*\par
147+
* Sponsored in part by the Defense Advanced Research Projects\par
148+
* Agency (DARPA) and Air Force Research Laboratory, Air Force\par
149+
* Materiel Command, USAF, under agreement number F39502-99-1-0512.\par
150+
*/\par
151+
/*-\par
152+
* Copyright (c) 2000 The NetBSD Foundation, Inc.\par
153+
* All rights reserved.\par
154+
*\par
155+
* This code is derived from software contributed to The NetBSD Foundation\par
156+
* by Dieter Baron and Thomas Klausner.\par
157+
*\par
158+
* Redistribution and use in source and binary forms, with or without\par
159+
* modification, are permitted provided that the following conditions\par
160+
* are met:\par
161+
* 1. Redistributions of source code must retain the above copyright\par
162+
* notice, this list of conditions and the following disclaimer.\par
163+
* 2. Redistributions in binary form must reproduce the above copyright\par
164+
* notice, this list of conditions and the following disclaimer in the\par
165+
* documentation and/or other materials provided with the distribution.\par
166+
*\par
167+
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\par
168+
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\par
169+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\par
170+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\par
171+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\par
172+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\par
173+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\par
174+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\par
175+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\par
176+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\par
177+
* POSSIBILITY OF SUCH DAMAGE.\par
178+
*/\par
179+
\par
180+
\par
181+
########################################################################\par
182+
# src/queue.h\par
183+
########################################################################\par
184+
For sys/queue.h:\par
185+
\par
186+
* Copyright (c) 1991, 1993\par
187+
*\tab The Regents of the University of California. All rights reserved.\par
188+
*\par
189+
* Redistribution and use in source and binary forms, with or without\par
190+
* modification, are permitted provided that the following conditions\par
191+
* are met:\par
192+
* 1. Redistributions of source code must retain the above copyright\par
193+
* notice, this list of conditions and the following disclaimer.\par
194+
* 2. Redistributions in binary form must reproduce the above copyright\par
195+
* notice, this list of conditions and the following disclaimer in the\par
196+
* documentation and/or other materials provided with the distribution.\par
197+
* 4. Neither the name of the University nor the names of its contributors\par
198+
* may be used to endorse or promote products derived from this software\par
199+
* without specific prior written permission.\par
200+
*\par
201+
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\par
202+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\par
203+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\par
204+
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\par
205+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\par
206+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\par
207+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\par
208+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\par
209+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\par
210+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\par
211+
* SUCH DAMAGE.\par
212+
*\par
213+
*\tab @(#)queue.h\tab 8.5 (Berkeley) 8/20/94\par
214+
* $FreeBSD$\par
215+
\par
216+
\par
217+
}
218+

LICENSE.queue

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
For sys/queue.h:
2+
3+
* Copyright (c) 1991, 1993
4+
* The Regents of the University of California. All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions
8+
* are met:
9+
* 1. Redistributions of source code must retain the above copyright
10+
* notice, this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright
12+
* notice, this list of conditions and the following disclaimer in the
13+
* documentation and/or other materials provided with the distribution.
14+
* 4. Neither the name of the University nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21+
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28+
* SUCH DAMAGE.
29+
*
30+
* @(#)queue.h 8.5 (Berkeley) 8/20/94
31+
* $FreeBSD$

examples/rdkafka_example.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@
3939
#include <csignal>
4040
#include <cstring>
4141

42+
#ifndef _MSC_VER
4243
#include <getopt.h>
43-
44+
#else
45+
#include "../win32/wingetopt.h"
46+
#endif
4447

4548
/*
4649
* Typically include path in a real application would be
@@ -130,7 +133,7 @@ int main (int argc, char **argv) {
130133
int64_t start_offset = RdKafka::Topic::OFFSET_BEGINNING;
131134
bool exit_eof = false;
132135
bool do_conf_dump = false;
133-
char opt;
136+
int opt;
134137
MyHashPartitionerCb hash_partitioner;
135138

136139
/*
@@ -141,7 +144,7 @@ int main (int argc, char **argv) {
141144

142145

143146
while ((opt = getopt(argc, argv, "PCt:p:b:z:qd:o:eX:AM:")) != -1) {
144-
switch (opt) {
147+
switch (opt) {
145148
case 'P':
146149
case 'C':
147150
mode = opt;
@@ -273,8 +276,8 @@ int main (int argc, char **argv) {
273276
"\n",
274277
argv[0],
275278
RdKafka::version_str().c_str(), RdKafka::version(),
276-
RdKafka::Conf::DEBUG_CONTEXTS.c_str());
277-
exit(1);
279+
RdKafka::get_debug_contexts().c_str());
280+
exit(1);
278281
}
279282

280283

@@ -356,7 +359,7 @@ int main (int argc, char **argv) {
356359
/*
357360
* Read messages from stdin and produce to broker.
358361
*/
359-
for (std::string line; run and std::getline(std::cin, line);) {
362+
for (std::string line; run && std::getline(std::cin, line);) {
360363
if (line.empty()) {
361364
producer->poll(0);
362365
continue;
@@ -381,7 +384,7 @@ int main (int argc, char **argv) {
381384
}
382385
run = true;
383386

384-
while (run and producer->outq_len() > 0) {
387+
while (run && producer->outq_len() > 0) {
385388
std::cerr << "Waiting for " << producer->outq_len() << std::endl;
386389
producer->poll(1000);
387390
}

src-cpp/ConfImpl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "rdkafkacpp_int.h"
3434

3535

36-
const std::string RdKafka::Conf::DEBUG_CONTEXTS = RD_KAFKA_DEBUG_CONTEXTS;
3736

3837
RdKafka::ConfImpl::ConfResult RdKafka::ConfImpl::set(const std::string &name,
3938
const std::string &value,

src-cpp/HandleImpl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int RdKafka::socket_cb_trampoline (int domain, int type, int protocol,
9393
}
9494

9595

96-
int RdKafka::open_cb_trampoline (const char *pathname, int flags, mode_t mode,
96+
int RdKafka::open_cb_trampoline (const char *pathname, int flags, int mode,
9797
void *opaque) {
9898
RdKafka::HandleImpl *handle = static_cast<RdKafka::HandleImpl *>(opaque);
9999

@@ -120,8 +120,10 @@ void RdKafka::HandleImpl::set_common_config (RdKafka::ConfImpl *confimpl) {
120120
}
121121

122122
if (confimpl->open_cb_) {
123+
#ifndef _MSC_VER // FIXME
123124
rd_kafka_conf_set_open_cb(confimpl->rk_conf_, RdKafka::open_cb_trampoline);
124125
open_cb_ = confimpl->open_cb_;
126+
#endif
125127
}
126128

127129
}

src-cpp/RdKafka.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ std::string RdKafka::version_str () {
3838
return std::string(rd_kafka_version_str());
3939
}
4040

41+
std::string RdKafka::get_debug_contexts() {
42+
return std::string(RD_KAFKA_DEBUG_CONTEXTS);
43+
}
44+
4145
std::string RdKafka::err2str (RdKafka::ErrorCode err) {
4246
return std::string(rd_kafka_err2str(static_cast<rd_kafka_resp_err_t>(err)));
4347
}

0 commit comments

Comments
 (0)