Page MenuHomeFreeBSD

stand: Allow stand.h to be included in C++ programs
ClosedPublic

Authored by imp on Jan 4 2023, 8:11 PM.
Tags
None
Referenced Files
F166465574: D37946.id114755.diff
Thu, Aug 13, 5:53 PM
F166465559: D37946.id114814.diff
Thu, Aug 13, 5:53 PM
F166465542: D37946.id114756.diff
Thu, Aug 13, 5:53 PM
F166465396: D37946.diff
Thu, Aug 13, 5:52 PM
Unknown Object (File)
Fri, Aug 7, 12:49 AM
Unknown Object (File)
Sat, Jul 25, 5:31 PM
Unknown Object (File)
May 19 2026, 6:58 AM
Unknown Object (File)
May 14 2026, 10:09 PM
Subscribers

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Jan 4 2023, 8:11 PM
stand/libsa/stand.h
65

Doing it around other headers is a bit gross

stand/libsa/stand.h
65

Indeed. I'll move this lower in the file.... but __BEGIN_DECLS is designed to nest :)

stand/libsa/stand.h
95

This is before the first structure that defines function pointers... Not ideal, but this file isn't well structured to limit its scope.

stand/libsa/stand.h
65

It does, until you have something that really is a C++ symbol... which isn't relevant here, and almost never comes up, but better to separate "us vs them", as it were...

stand/libsa/stand.h
65

Fair point. It's why I went ahead and moved it :). The rest of our tree is C++ clean (at least the subset used by the boot loader).

This revision is now accepted and ready to land.Jan 4 2023, 9:27 PM