mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
qnx: qnx6.5 compatibility
This commit is contained in:
parent
d2a1bbd8aa
commit
39e19c85f1
9 changed files with 50 additions and 5 deletions
|
@ -723,6 +723,7 @@ if (NOT LWS_HAVE_GETIFADDRS)
|
|||
set(LWS_BUILTIN_GETIFADDRS 1)
|
||||
endif()
|
||||
|
||||
CHECK_INCLUDE_FILE(getopt.h LWS_HAS_GETOPT_LONG)
|
||||
CHECK_INCLUDE_FILE(dlfcn.h LWS_HAVE_DLFCN_H)
|
||||
CHECK_INCLUDE_FILE(fcntl.h LWS_HAVE_FCNTL_H)
|
||||
CHECK_INCLUDE_FILE(in6addr.h LWS_HAVE_IN6ADDR_H)
|
||||
|
@ -817,6 +818,14 @@ CHECK_C_SOURCE_COMPILES("#define _GNU_SOURCE
|
|||
return 0;
|
||||
}" LWS_HAS_PTHREAD_SETNAME_NP)
|
||||
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <getopt.h>
|
||||
int main(void) {
|
||||
void *p = (void *)getopt_long;
|
||||
return p != NULL;
|
||||
}" LWS_HAS_GETOPT_LONG)
|
||||
|
||||
|
||||
if (NOT PID_T_SIZE)
|
||||
set(pid_t int)
|
||||
endif()
|
||||
|
|
|
@ -21,12 +21,14 @@
|
|||
#cmakedefine LWS_BUILTIN_GETIFADDRS
|
||||
#cmakedefine LWS_FALLBACK_GETHOSTBYNAME
|
||||
#cmakedefine LWS_HAS_INTPTR_T
|
||||
#cmakedefine LWS_HAS_GETOPT_LONG
|
||||
#cmakedefine LWS_HAVE__ATOI64
|
||||
#cmakedefine LWS_HAVE_ATOLL
|
||||
#cmakedefine LWS_HAVE_BN_bn2binpad
|
||||
#cmakedefine LWS_HAVE_ECDSA_SIG_set0
|
||||
#cmakedefine LWS_HAVE_EVP_MD_CTX_free
|
||||
#cmakedefine LWS_HAVE_EVP_aes_128_wrap
|
||||
#cmakedefine LWS_HAS_GETOPT_LONG
|
||||
#cmakedefine LWS_HAVE_LIBCAP
|
||||
#cmakedefine LWS_HAVE_MALLOC_H
|
||||
#cmakedefine LWS_HAVE_mbedtls_net_init
|
||||
|
|
|
@ -348,7 +348,10 @@ lws_create_adopt_udp(struct lws_vhost *vhost, int port, int flags,
|
|||
h.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
|
||||
h.ai_socktype = SOCK_DGRAM;
|
||||
h.ai_protocol = IPPROTO_UDP;
|
||||
h.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
|
||||
h.ai_flags = AI_PASSIVE;
|
||||
#ifdef AI_ADDRCONFIG
|
||||
h.ai_flags |= AI_ADDRCONFIG;
|
||||
#endif
|
||||
|
||||
lws_snprintf(buf, sizeof(buf), "%u", port);
|
||||
n = getaddrinfo(NULL, buf, &h, &r);
|
||||
|
|
|
@ -960,7 +960,7 @@ lwsws_get_config_d(void *user, const char *d, const char * const *paths,
|
|||
char path[256];
|
||||
int n, i, ret = 0;
|
||||
|
||||
n = scandir(d, &namelist, filter, alphasort);
|
||||
n = scandir((char *) d, &namelist, filter, alphasort);
|
||||
if (n < 0) {
|
||||
lwsl_err("Scandir on %s failed\n", d);
|
||||
return 1;
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -75,12 +77,14 @@ static const char * const plugin_dirs[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
static struct option options[] = {
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "debug", required_argument, NULL, 'd' },
|
||||
{ "configdir", required_argument, NULL, 'c' },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
void signal_cb(uv_signal_t *watcher, int signum)
|
||||
{
|
||||
|
@ -216,7 +220,11 @@ int main(int argc, char **argv)
|
|||
|
||||
strcpy(config_dir, "/etc/lwsws");
|
||||
while (n >= 0) {
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
n = getopt_long(argc, argv, "hd:c:", options, NULL);
|
||||
#else
|
||||
n = getopt(argc, argv, "hd:c:");
|
||||
#endif
|
||||
if (n < 0)
|
||||
continue;
|
||||
switch (n) {
|
||||
|
|
|
@ -8,9 +8,12 @@
|
|||
*/
|
||||
|
||||
#include <libwebsockets.h>
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
static struct option options[] = {
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "createindex", no_argument, NULL, 'c' },
|
||||
|
@ -20,6 +23,7 @@ static struct option options[] = {
|
|||
{ "lines", required_argument, NULL, 'l' },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
static const char *index_filepath = "/tmp/lws-fts-test-index";
|
||||
static char filepath[256];
|
||||
|
@ -35,7 +39,11 @@ int main(int argc, char **argv)
|
|||
char buf[16384];
|
||||
|
||||
do {
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
n = getopt_long(argc, argv, "hd:i:cfl", options, NULL);
|
||||
#else
|
||||
n = getopt(argc, argv, "hd:i:cfl");
|
||||
#endif
|
||||
if (n < 0)
|
||||
continue;
|
||||
switch (n) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
|
@ -526,6 +528,7 @@ void sighandler(int sig)
|
|||
force_exit = 1;
|
||||
}
|
||||
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
static struct option options[] = {
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "debug", required_argument, NULL, 'd' },
|
||||
|
@ -550,6 +553,7 @@ static struct option options[] = {
|
|||
#endif
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
static int ratelimit_connects(unsigned int *last, unsigned int secs)
|
||||
{
|
||||
|
@ -589,8 +593,11 @@ int main(int argc, char **argv)
|
|||
goto usage;
|
||||
|
||||
while (n >= 0) {
|
||||
n = getopt_long(argc, argv, "Sjnuv:hsp:d:lC:K:A:P:moeO", options,
|
||||
NULL);
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
n = getopt_long(argc, argv, "Sjnuv:hsp:d:lC:K:A:P:moeO", options, NULL);
|
||||
#else
|
||||
n = getopt(argc, argv, "Sjnuv:hsp:d:lC:K:A:P:moeO");
|
||||
#endif
|
||||
if (n < 0)
|
||||
continue;
|
||||
switch (n) {
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
#include <libwebsockets.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
|
||||
int close_testing;
|
||||
|
@ -298,6 +300,7 @@ static const struct lws_protocol_vhost_options pvo = {
|
|||
"" /* ignored */
|
||||
};
|
||||
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
static struct option options[] = {
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "debug", required_argument, NULL, 'd' },
|
||||
|
@ -323,6 +326,7 @@ static struct option options[] = {
|
|||
{ "pingpong-secs", required_argument, NULL, 'P' },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
@ -353,7 +357,11 @@ int main(int argc, char **argv)
|
|||
info.port = 7681;
|
||||
|
||||
while (n >= 0) {
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
n = getopt_long(argc, argv, "eci:hsap:d:DC:K:A:R:vu:g:P:kU:n", options, NULL);
|
||||
#else
|
||||
n = getopt(argc, argv, "eci:hsap:d:DC:K:A:R:vu:g:P:kU:n");
|
||||
#endif
|
||||
if (n < 0)
|
||||
continue;
|
||||
switch (n) {
|
||||
|
|
Loading…
Add table
Reference in a new issue