git: bc81728c00b2 - main - [test] libatexit: leverage __{BEGIN,END}_DECLS

From: Enji Cooper <ngie_at_FreeBSD.org>
Date: Sat, 25 Jul 2026 16:56:21 UTC
The branch main has been updated by ngie:

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

commit bc81728c00b200297ac556974b5373c804077a17
Author:     Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2026-07-25 16:51:53 +0000
Commit:     Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-07-25 16:55:38 +0000

    [test] libatexit: leverage __{BEGIN,END}_DECLS
    
    This change converts the longhand form of `extern "C" {` and its
    corresponding `}` into `__BEGIN_DECLS` and `__END_DECLS`, respectively.
    
    The new form is much easier to grep for and is a best practice to use in
    the FreeBSD tree.
    
    This is meant to be a non-functional change.
    
    MFC after:      1 week
---
 lib/libc/tests/stdlib/libatexit/libatexit.cc | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/libc/tests/stdlib/libatexit/libatexit.cc b/lib/libc/tests/stdlib/libatexit/libatexit.cc
index 7c5a7126d178..5dcbe8a33dc0 100644
--- a/lib/libc/tests/stdlib/libatexit/libatexit.cc
+++ b/lib/libc/tests/stdlib/libatexit/libatexit.cc
@@ -5,15 +5,18 @@
  *
  */
 
+#include <sys/cdefs.h>
 #include <unistd.h>
 
 static int exit_code = -1;
 static bool fatal_atexit;
 
-extern "C" {
-	void set_fatal_atexit(bool);
-	void set_exit_code(int);
-}
+__BEGIN_DECLS
+
+void set_fatal_atexit(bool);
+void set_exit_code(int);
+
+__END_DECLS
 
 void
 set_fatal_atexit(bool fexit)