summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2017-07-30 23:42:41 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2017-07-30 23:45:01 -0400
commit3c8afd194c8d13fecefa1fa8862eaae630208325 (patch)
tree7df07fcea59c1a0f4b7ae999f9e9b119254515e1
parent2e0f87c8a5df45ddb4b93bac4e01584c7897ca2b (diff)
downloadlighttpd1.4-3c8afd194c8d13fecefa1fa8862eaae630208325.tar.gz
lighttpd1.4-3c8afd194c8d13fecefa1fa8862eaae630208325.zip
[core] base_decls.h to quiet compiler warnings
quiet compiler warning for -Wtypedef-redefinition (redefinition of typedef is a C11 feature)
-rw-r--r--src/Makefile.am2
-rw-r--r--src/base.h21
-rw-r--r--src/base_decls.h18
-rw-r--r--src/inet_ntop_cache.h6
-rw-r--r--src/log.h4
-rw-r--r--src/status_counter.h3
6 files changed, 29 insertions, 25 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c8582029..92a0f167 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -380,7 +380,7 @@ hdr = server.h base64.h buffer.h network.h log.h keyvalue.h \
response.h request.h fastcgi.h chunk.h \
first.h settings.h http_chunk.h \
algo_sha1.h md5.h http_auth.h http_vhostdb.h stream.h \
- fdevent.h gw_backend.h connections.h base.h stat_cache.h \
+ fdevent.h gw_backend.h connections.h base.h base_decls.h stat_cache.h \
plugin.h \
etag.h joblist.h array.h vector.h crc32.h \
network_backends.h configfile.h \
diff --git a/src/base.h b/src/base.h
index 1ba123ab..62075009 100644
--- a/src/base.h
+++ b/src/base.h
@@ -18,6 +18,7 @@
# include <inttypes.h>
#endif
+#include "base_decls.h"
#include "buffer.h"
#include "array.h"
#include "chunk.h"
@@ -102,16 +103,8 @@ typedef struct {
char *value;
} request_handler;
-typedef struct {
- char *key;
- char *host;
- unsigned short port;
- int used;
- short factor;
-} fcgi_connections;
-
-typedef union sock_addr {
+union sock_addr {
#ifdef HAVE_IPV6
struct sockaddr_in6 ipv6;
#endif
@@ -120,7 +113,7 @@ typedef union sock_addr {
struct sockaddr_un un;
#endif
struct sockaddr plain;
-} sock_addr;
+};
/* fcgi_response_header contains ... */
#define HTTP_STATUS BV(0)
@@ -336,7 +329,7 @@ typedef struct {
buffer *comp_value; /* just a pointer */
} cond_cache_t;
-typedef struct connection {
+struct connection {
connection_state_t state;
/* timestamps */
@@ -420,7 +413,7 @@ typedef struct connection {
etag_flags_t etag_flags;
int conditional_is_valid[COMP_LAST_ELEMENT];
-} connection;
+};
typedef struct {
connection **ptr;
@@ -516,7 +509,7 @@ typedef struct {
size_t used;
} server_socket_array;
-typedef struct server {
+struct server {
server_socket_array srv_sockets;
/* the errorlog */
@@ -607,7 +600,7 @@ typedef struct server {
uid_t uid;
gid_t gid;
-} server;
+};
#endif
diff --git a/src/base_decls.h b/src/base_decls.h
new file mode 100644
index 00000000..f8874756
--- /dev/null
+++ b/src/base_decls.h
@@ -0,0 +1,18 @@
+#ifndef INCLUDED_BASE_DECLS_H
+#define INCLUDED_BASE_DECLS_H
+
+#include "first.h"
+
+#include <sys/types.h>
+
+struct server;
+typedef struct server server;
+
+struct connection;
+typedef struct connection connection;
+
+union sock_addr;
+typedef union sock_addr sock_addr;
+
+
+#endif
diff --git a/src/inet_ntop_cache.h b/src/inet_ntop_cache.h
index 9e7e98f0..c38bbf56 100644
--- a/src/inet_ntop_cache.h
+++ b/src/inet_ntop_cache.h
@@ -4,13 +4,9 @@
#include <sys/types.h>
#include "sys-socket.h"
+#include "base_decls.h"
#include "buffer.h"
-struct server;
-typedef struct server server;
-union sock_addr;
-typedef union sock_addr sock_addr;
-
unsigned short sock_addr_get_port (const sock_addr *addr);
int sock_addr_inet_pton(sock_addr *addr, const char *str, int family, unsigned short port);
diff --git a/src/log.h b/src/log.h
index 0c09378d..50f031e9 100644
--- a/src/log.h
+++ b/src/log.h
@@ -3,11 +3,9 @@
#include "first.h"
#include <sys/types.h>
+#include "base_decls.h"
#include "buffer.h"
-struct server; /* declaration */
-typedef struct server server;
-
struct timespec; /* declaration */
int log_clock_gettime_realtime (struct timespec *ts);
diff --git a/src/status_counter.h b/src/status_counter.h
index 9d6e62ee..d0ee533e 100644
--- a/src/status_counter.h
+++ b/src/status_counter.h
@@ -4,9 +4,8 @@
#include <sys/types.h>
+#include "base_decls.h"
#include "array.h"
-struct server;
-typedef struct server server;
data_integer *status_counter_get_counter(server *srv, const char *s, size_t len);
int status_counter_inc(server *srv, const char *s, size_t len);