gcc 4.4.7 (hello RHEL 6) complains about redefinition of typedefs,
as in:
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -DSYSCONFDIR='"/usr/local/etc"' -g -O2 -g -O2 -MT nbd_client-buffer.o -MD -MP -MF .deps/nbd_client-buffer.Tpo -c -o nbd_client-buffer.o `test -f 'buffer.c' || echo './'`buffer.c
buffer.c:39: error: redefinition of typedef ‘buffer_t’
buffer.h:31: note: previous declaration of ‘buffer_t’ was here
The .c file only has to declare the struct being typedef'd, not
repeat the typedef declaration.
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Wouter Verhelst <w@uter.be>
#include "buffer.h"
-typedef struct buffer
+struct buffer
{
char *buf;
ssize_t size;
ssize_t ridx;
ssize_t widx;
int empty;
-} buffer_t;
+};
/* the buffer is organised internally as follows:
*
#define PRIORITY "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2"
-typedef struct tlssession
+struct tlssession
{
gnutls_certificate_credentials_t creds;
gnutls_session_t session;
int (*erroutfn) (void *opaque, const char *format, va_list ap);
int debug;
void *opaque;
-} tlssession_t;
+};
#define BUF_SIZE 65536
#define BUF_HWM ((BUF_SIZE*3)/4)