From the FormatMessage() Win32 API documentation: "The lpBuffer
parameter is a pointer to an LPTSTR; you must cast the pointer
to an LPTSTR (for example, (LPTSTR)&lpBuffer)."
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessage#parameters
This commit fixes warnings like these:
warning C4047: 'function': 'LPSTR' differs in levels of indirection from 'char **'
warning C4024: 'FormatMessageA': different types for formal and actual parameter 5
Signed-off-by: Sigmund Vik <sigmund_vik@yahoo.com>
This fixes Visual Studio compiler warnings like this one:
"warning C4003: not enough arguments for function-like
macro invocation 'G_MSGS_DROPPED_INC'"
Signed-off-by: Sigmund Vik <sigmund_vik@yahoo.com>
Before this commit there was no good way to detect that the
Mosquitto broker was done with its startup phase on systems
without systemd.
On such systems it was tricky to e.g. start the broker from
a test where ports are dynamically assigned and one have to
deal with potential port conflicts. Without a way to know
that the broker is done with its startup phase, there was no
way to know if the broker was able to acquire the port (for
both IPv4 and IPv6) without waiting for some unknown period
of time (when many tests are run in parallel a single process
might be starved for resources).
With this new broker ready message it is easy for the parent
process to monitor the broker output and figure out when the
port was successfully acquired.
Signed-off-by: Sigmund Vik <sigmund_vik@yahoo.com>
Add a refcount around mosquitto_lib_init and mosquitto_lib_cleanup so
that multiple calls to init/cleanup don't trigger memory leaks or
double-frees.
Signed-off-by: Martin Kelly <mkelly@xevo.com>
We currently erroneously claim that mosquitto_lib_init cannot fail,
while it can fail on Windows, if WSAStartup fails in net__init. Correct
this.
Signed-off-by: Martin Kelly <mkelly@xevo.com>
Add a refcount around mosquitto_lib_init and mosquitto_lib_cleanup so
that multiple calls to init/cleanup don't trigger memory leaks or
double-frees.
Signed-off-by: Martin Kelly <mkelly@xevo.com>