Browse Source

[core] base_decls.h to quiet compiler warnings

quiet compiler warning for -Wtypedef-redefinition
(redefinition of typedef is a C11 feature)
personal/stbuehler/mod-csrf
Glenn Strauss 4 years ago
parent
commit
3c8afd194c
  1. 2
      src/Makefile.am
  2. 21
      src/base.h
  3. 18
      src/base_decls.h
  4. 6
      src/inet_ntop_cache.h
  5. 4
      src/log.h
  6. 3
      src/status_counter.h

2
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 \

21
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

18
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

6
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);

4
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);

3
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);

Loading…
Cancel
Save