git: 5e4f201c7ded - stable/13 - stand: Allow stand.h to be included in C++ programs

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 24 Jan 2023 22:14:11 UTC
The branch stable/13 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=5e4f201c7dedcb891ed98e3916683184a119079e

commit 5e4f201c7dedcb891ed98e3916683184a119079e
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-01-07 01:39:09 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:44 +0000

    stand: Allow stand.h to be included in C++ programs
    
    Allow stand.h to be included in C++ programs. This is little more than
    using our stylized __BEGIN_DECL / __END_DECL around the entire
    file. There's no run-time support for C++, so the C++ that can be used
    is quite limited. It is enough for libunwind, though.
    
    Sponsored by:           Netflix
    Reviewed by:            jrtc27, kevans
    Differential Revision:  https://reviews.freebsd.org/D37946
    
    (cherry picked from commit 5cf20707ba79b5c06b26381da0013c65004b53be)
---
 stand/libsa/stand.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h
index c0550104bca0..b5087d17e114 100644
--- a/stand/libsa/stand.h
+++ b/stand/libsa/stand.h
@@ -61,8 +61,9 @@
 #ifndef	STAND_H
 #define	STAND_H
 
-#include <sys/types.h>
 #include <sys/cdefs.h>
+
+#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/dirent.h>
 #include <sys/queue.h>
@@ -90,6 +91,8 @@
 /* Partial signal emulation for sig_atomic_t */
 #include <machine/signal.h>
 
+__BEGIN_DECLS
+
 struct open_file;
 
 /*
@@ -509,4 +512,6 @@ void tslog(const char *, const char *, const char *);
 void tslog_setbuf(void * buf, size_t len);
 void tslog_getbuf(void ** buf, size_t * len);
 
+__END_DECLS
+
 #endif	/* STAND_H */