summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/lighttpd/lighttpd/0002-define-__BEGIN_DECLS-__END_DECLS-if-needed.patch
blob: 2a9bb352b50f1af1909d166c768250de67af42d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From c1466f3620f608e4def4b8853c4e2bc6d9a19646 Mon Sep 17 00:00:00 2001
From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Mon, 4 Oct 2021 09:51:22 -0400
Subject: [PATCH] define __BEGIN_DECLS, __END_DECLS if needed

Upstream-Status: Backport
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 src/first.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/first.h b/src/first.h
index df747ba..9d0428a 100644
--- a/src/first.h
+++ b/src/first.h
@@ -39,6 +39,22 @@
 #include <sys/types.h>
 #include <stddef.h>
 
+#ifndef __BEGIN_DECLS
+#ifdef __cplusplus
+#define __BEGIN_DECLS extern "C" {
+#else
+#define __BEGIN_DECLS
+#endif
+#endif
+
+#ifndef __END_DECLS
+#ifdef __cplusplus
+#define __END_DECLS }
+#else
+#define __END_DECLS
+#endif
+#endif
+
 #if defined HAVE_STDINT_H
 # include <stdint.h>
 #elif defined HAVE_INTTYPES_H