Commit Graph

51 Commits

Author SHA1 Message Date
Luca Boccassi
da31917f4f Relicense from LGPL3 + exceptions to Mozilla Public License version 2.0
Relicense permission collected from all relevant authors as tallied at:
https://github.com/rlenferink/libzmq-relicense/blob/master/checklist.md
The relicense grants are collected under RELICENSE/ and will be moved
to the above repository in a later commit.

Fixes https://github.com/zeromq/libzmq/issues/2376
2023-06-05 20:31:47 +01:00
Simon Giesecke
41e3f14d6a Problem: ptr/ref parameters and local variables are non-const but never modified
Solution: add const
2020-01-27 10:38:00 +01:00
Simon Giesecke
3dbbc28bb8 Problem: use of unsafe strcpy
Solution: use memcpy with known size instead
2019-12-25 13:56:26 +01:00
Simon Giesecke
bbae67df89 Code style improvements 2018-08-10 15:36:31 +02:00
Simon Giesecke
37344d0b7c Problem: redundant old-style void argument declarations
Solution: remove
2018-05-26 09:34:45 +02:00
Simon Giesecke
c581f43c97 Problem: parameter naming style inconsistent
Solution: define and apply parameter naming style: lower_case_
2018-05-26 09:34:44 +02:00
Simon Giesecke
4e616f30dd Problem: C-style casts used
Solution: replace by C++-style casts
2018-05-18 17:04:01 +02:00
Luca Boccassi
7ba074fa28 Problem: Sun Studio build errors
Solution: add compiler flags to support extensions like anonymous
structs in unions, fix casting of const, and check for suncc rather
than solaris
2018-05-13 18:24:50 +01:00
asafkahlon
8e8009ec5d Implement the wsa_error_no function with switch-case (#3044)
* Implement the wsa_error_no function with switch-case

Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
2018-04-13 15:16:54 +01:00
sigiesec
41f459e1dc Problem: formatting inconsistent
Solution: applied clang-format
2018-02-02 15:47:43 +01:00
Luca Boccassi
dc51ebeb1f Problem: valgrind shows unitialised errors in backtrace print
Solution: fix them
2017-08-05 18:04:15 +01:00
bjovke
9ef34addb8 Problem: When using print_backtrace() on Linux with libunwind, printout of stack traces from multiple threads are interleaved. Solution: added static mutex to serialize printing of stack traces. 2017-06-27 20:29:08 +02:00
Cziken
d514bb598a Fixed handling of WSAEWOULDBLOCK to be generic (#2260)
* Fixed handling of WSAEWOULDBLOCK to be generic

I don't know what was the intention of this early if statement but
now this is properly evaluated in wsa_error_no function if this is
performance issue I suggest moving evaluating this error code to the
beginning of wsa_error_no.

* Fixed handling of WSAEWOULDBLOCK to be generic

Introduced default pointer to const char * and overrides this as NULL
if function is called by zmq::wsa_error()

* Fixed handling of WSAEWOULDBLOCK to be generic

Introduced default pointer to const char * and overrides this as NULL
if function is called by zmq::wsa_error()
2016-12-16 15:51:00 +01:00
Juha Reunanen
57c765ef5a Add EHOSTUNREACH to errno_to_string 2016-10-18 06:46:50 +03:00
Luca Boccassi
8045e9ae24 Problem: no backtrace is printed on assert
Solution: add an optional dependency on libunwind, and if present
use it to print the backtrace when zmq_abort is called.
2016-05-06 21:34:25 +01:00
hitstergtd
b2d0ab18f2 Problem: trailing whitespace in code
Solution: fix them
2016-04-25 12:18:46 +01:00
Osiris
4a5af9d58b Problem: Precompiled headers not being used
Solution: Phase I - make precompiled.hpp be first file included in every source file
2016-02-18 10:56:52 -06:00
Michael
3cdc9218c2 remove include that is already in header 2016-02-06 22:36:37 +11:00
Constantin Rack
a539b0c6e8 Problem: copyright year is still 2015
Solution: update to 2016
2016-01-28 15:07:31 +01:00
reza.ebrahimi
8e6ef4616e changing some camelCase variable names to snake_case in previous commit 2015-08-14 16:56:07 +04:30
reza.ebrahimi
d7b74d1f57 remove unnecessary multiple WSAGetLastError() calls 2015-08-14 16:29:18 +04:30
evoskuil
81aa6f45a4 Style and explicitness. 2015-07-26 17:37:38 -07:00
Pieter Hintjens
8620c3e032 Problem: source file headers are somewhat confusing about LGPLv3
Of course people still "can" distributed the sources under the
LGPLv3. However we provide COPYING.LESSER with additional grants.

Solution: specify these grants in the header of each source file.
2015-06-02 22:33:55 +02:00
Pieter Hintjens
94d9a4ffdf Problem: copyright statements are out of date
Solution: update for 2015

Fixes #1320
2015-01-22 10:32:37 +01:00
Olaf Mandel
ab5775fb00 Fix failed assertion for WSAENOTSOCK
In de9eef306, the error number assigned to WSAENOTSOCK was EFAULT, but
zmq.cpp:919 expects an ENOTSOCK in this case.
2014-06-10 14:45:04 +02:00
Olaf Mandel
de9eef3063 Extend zmq::wsa_error_to_errno()
The list of error codes is taken from zmq::wsa_error_no(). Most of the
new WSA error codes result in EFAULT, but some return a more specific
value (even EAGAIN).

Fixes #1071
2014-06-04 17:28:01 +02:00
Pieter Hintjens
b3b9e046ee Updated copyright statements for 2014 2014-01-02 12:00:57 +01:00
Pieter Hintjens
f0f16505e5 Removed corporate advertisements from source file headers
Copyrights had become ads for Sustrik's corporate sponsors, going against the original
agreement to share copyrights with the community (that agreement was: one line stating
iMatix copyright + one reference to AUTHORS file). The proliferation of corporate ads
is also unfair to the many individual authors. I've removed ALL corporate title from
the source files so the copyright statements can now be centralized in AUTHORS and
source files can be properly updated on an annual basis.
2013-03-12 13:24:57 +01:00
Sébastien Rombauts
41d79bc19e Windows CE support : using standard _WIN32_WCE flag instead of WINCE
- when compiling for Windows CE, a C++ project must define the preprocessor definitions: UNDER_CE=$(CEVersion),_WIN32_WCE=$(CEVersion)
- choosing the "_WIN32_CE" form for uniformization with "_WIN32" and "_WIN32_WINNT" already used in libzmq (boost is using both forms)
- see http://msdn.microsoft.com/en-us/library/ee479161(v=winembedded.60).aspx
2013-02-19 16:49:23 +01:00
Arthur O'Dwyer
3b984d40e9 Silence all "unused parameter" warnings from Clang.
Compiling without warnings is a good goal, because it makes
new warnings (which probably indicate bugs) stand out rather
than getting lost in the spam.

My fixes fall into two categories:

    - Adding (void) casts of unused parameters, where their
      unusedness seems like a TODO (or in some cases a bug?).

    - Removing parameter names altogether, where the function
      is clearly a stub that will never use its parameters.

Should be no change in behavior.
2012-08-27 16:05:51 -07:00
Steven McCoy
acbb99383f Add additional Windows Sockets Error Codes. 2012-06-13 19:42:11 -04:00
Martin Hurton
13ef1e4f26 Make wsa_error_to_errno pure function 2012-05-27 16:10:19 +02:00
boris@boressoft.ru
318ba8836f Add WinCE support.
* Added two new files: errno.hpp and errno.cpp. They are required to use errno functionality on WM.
* zmq.cpp, msg.h: removed inclusion of errno.h because it is included in zmq.h that is also included by .cpp.
* windows.hpp: process.h is included only for desktop builds.
* thread.cpp: on CE CreateThread is used instead of __beginthreadex
* socket_base.cpp, clock.cpp: on CE include cmnintrin.h instead on intrin.h
* signaler.cpp: on Windows should use special macro around event name (for unicode builds)
* err.hpp: make it include errno.hpp (my file) instead on errno.h when building for CE
* err.cpp: use FormatMessage when building for CE (because CE does not have ANSI API functions)
* zmq.h: do not include errno.h whe building for CE
* libzmq.vcproj: add tro new files
2012-03-14 19:12:28 +04:00
Pieter Hintjens
afe8cd503f Revert "fix warn unused"
- anonymous contributor

This reverts commit 7b7d404269.
2012-02-14 18:43:33 -06:00
niXman
7b7d404269 fix warn unused 2012-02-10 13:39:34 +04:00
Martin Sustrik
8e21d64c97 Copyright dates adjusted to reflect reality
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01 18:06:11 +01:00
Martin Sustrik
ac7717b7b3 250bpm copyrights added
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31 16:20:30 +01:00
Paul Betts
1b706ac028 Enable exceptions raising on assert on Win32
This patch changes the Win32 version to call RaiseException instead of abort
(which eventually calls TerminateProcess). This allows crash dumps to be sent
correctly instead of the process disappearing.

Signed-off-by: Paul Betts <paul@paulbetts.org>
2011-10-27 11:48:58 +02:00
Martin Sustrik
714d3b288f EAFNOSUPPORT defined on Windows platform
Windows headers don't defined this error.
This patch defines it if not already defined.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-08-15 20:39:48 +02:00
Martin Sustrik
49df2f416c Fixes warning when compiling with MSVC on Win64
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-15 13:12:09 +02:00
Martin Sustrik
49387874ef Async connect doesn't fail on EWSANETDOWN
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-08 09:03:49 +02:00
Martin Sustrik
e0246e32d7 Message-related functionality factored out into msg_t class.
This patch addresses serveral issues:
1. It gathers message related functionality scattered over whole
   codebase into a single class.
2. It makes zmq_msg_t an opaque datatype. Internals of the class
   don't pollute zmq.h header file.
3. zmq_msg_t size decreases from 48 to 32 bytes. That saves ~33%
   of memory in scenarios with large amount of small messages.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-21 22:27:48 +02:00
Martin Sustrik
18b9ebea32 The copyrights in file headers updated.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-02 16:30:40 +01:00
Martin Sustrik
b358df9fff Name of "GNU Lesser Public License" corrected.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-30 15:08:28 +02:00
Martin Sustrik
72b15a6dae Implementation of zmq_strerror moved from zmq.cpp to err.cpp
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-16 16:05:34 +02:00
Martin Lucina
27e2d08449 Restructure language bindings
C and C++ headers moved from bindings/ to include/, bindings/ removed
--with-c and --with-cpp options to configure removed, C and C++ now built
and installed by default
2010-03-11 20:33:27 +01:00
Martin Sustrik
4f6baf4dde Copyrights transferred from FastMQ to iMatix 2010-01-05 08:29:35 +01:00
unknown
49a9ef5fcb windows error handling improved 2009-10-01 13:48:04 +02:00
Martin Sustrik
e136d923b7 ZMQ-specific error codes added 2009-09-22 11:52:35 +02:00
Martin Sustrik
cc3755a16f renamed from zs to zmq 2009-08-03 11:30:13 +02:00