diff options
author | walley <walley@walley.org> | 2023-01-24 10:03:48 +0100 |
---|---|---|
committer | Rodrigo Arias <rodarima@gmail.com> | 2023-06-02 13:19:10 +0200 |
commit | 4d35673f69d837db894305f3b3b618a26d0277c7 (patch) | |
tree | 09ef3acf1f2a292cc9178f870df36c52c40df0fa | |
parent | 479a133f0f6fee3138ea1c0316a1689e8ea26d99 (diff) |
Fix for gcc 10
Gcc 10 defaults to -fno-common, leading to multiple global definitions
to cause a linker error.
-rw-r--r-- | dpid/dpid.h | 14 | ||||
-rw-r--r-- | dpid/dpid_common.h | 7 | ||||
-rw-r--r-- | dpid/main.c | 20 |
3 files changed, 29 insertions, 12 deletions
diff --git a/dpid/dpid.h b/dpid/dpid.h index 8ef67dd5..7186d4ff 100644 --- a/dpid/dpid.h +++ b/dpid/dpid.h @@ -25,10 +25,10 @@ /*! \TODO: Should read this from dillorc */ #define SRS_NAME "dpid.srs" -char *srs_name; +extern char *srs_name; /*! dpid's service request socket file descriptor */ -int srs_fd; +extern int srs_fd; /*! plugin state information */ @@ -49,19 +49,19 @@ struct service { }; /*! Number of available plugins */ -int numdpis; +extern int numdpis; /*! Number of sockets being watched */ -int numsocks; +extern int numsocks; /*! State information for each plugin. */ -struct dp *dpi_attr_list; +extern struct dp *dpi_attr_list; /*! service served for each plugin */ -Dlist *services_list; +extern Dlist *services_list; /*! Set of sockets watched for connections */ -fd_set sock_set; +extern fd_set sock_set; /*! Set to 1 by the SIGCHLD handler dpi_sigchld */ extern volatile sig_atomic_t caught_sigchld; diff --git a/dpid/dpid_common.h b/dpid/dpid_common.h index 6df55ae1..fd0e094f 100644 --- a/dpid/dpid_common.h +++ b/dpid/dpid_common.h @@ -35,12 +35,9 @@ #define CKD_WRITE(fd, msg) ckd_write(fd, msg, __FILE__, __LINE__) #define CKD_CLOSE(fd) ckd_close(fd, __FILE__, __LINE__) - /*! Error codes for dpid */ -enum { - no_errors, - dpid_srs_addrinuse /* dpid service request socket address already in use */ -} dpi_errno; +//fix for gcc 10 +extern enum dpi_errno; /*! Intended for identifying dillo plugins * and related files diff --git a/dpid/main.c b/dpid/main.c index 6350a2b6..823a243e 100644 --- a/dpid/main.c +++ b/dpid/main.c @@ -1,5 +1,7 @@ /* Copyright (C) 2003 Ferdi Franceschini <ferdif@optusnet.com.au> + 2020 Axel Beckert <abe@debian.org> + 2023 Michal Grezl <walley@walley.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +34,24 @@ sigset_t mask_sigchld; +/* fix for gcc 10 */ + +enum { + no_errors, + dpid_srs_addrinuse /* dpid service request socket address already in use */ +} dpi_errno; + +char *srs_name; +int numdpis; +fd_set sock_set; +struct dp *dpi_attr_list; +Dlist *services_list; +int numsocks; +int srs_fd; +; + +// end of fix + /* Start a dpi filter plugin after accepting the pending connection * \Return |