Skip to content

Commit

Permalink
net-snmp: support compilation with GCC 11 permissively
Browse files Browse the repository at this point in the history
Use #elif defined instead of #elifdef as seen elsewhere throughout the patch
file. This avoids the following errors when compiling with GCC 11:

```
mibgroup/ucd-snmp/proc.c:45:2: error: invalid preprocessing directive #elifdef; did you mean #ifdef?
   45 | #elifdef HAVE_PCRE_H
      |  ^~~~~~~
      |  ifdef

mibgroup/ucd-snmp/proc.c:243:2: error: invalid preprocessing directive #elifdef; did you mean #ifdef?
  243 | #elifdef HAVE_PCRE_H
      |  ^~~~~~~
      |  ifdef
```

Signed-off-by: Wei-Ting Yang <[email protected]>
  • Loading branch information
Yang-Wei-Ting authored and William Yang committed Dec 18, 2024
1 parent 6f9bd7d commit c103291
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/net-snmp/patches/200-add-pcre2-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Subject: [PATCH] add pcre2 support
+#ifdef HAVE_PCRE2_H
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include <pcre2.h>
+#elifdef HAVE_PCRE_H
+#elif defined(HAVE_PCRE_H)
#include <pcre.h>
#endif

Expand Down Expand Up @@ -262,7 +262,7 @@ Subject: [PATCH] add pcre2 support
+ if ((*procp)->regexp.regex_ptr == NULL) {
+ config_perror(pcre2_error_msg);
+ }
+#elifdef HAVE_PCRE_H
+#elif defined(HAVE_PCRE_H)
const char *pcre_error;
int pcre_error_offset;

Expand Down

0 comments on commit c103291

Please sign in to comment.