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
Unknown Object (File)
Tue, Jul 2, 2:58 PM
Unknown Object (File)
Apr 26 2024, 8:47 AM
Unknown Object (File)
Apr 26 2024, 8:47 AM
Unknown Object (File)
Apr 26 2024, 8:47 AM
Unknown Object (File)
Apr 26 2024, 8:47 AM
Unknown Object (File)
Apr 26 2024, 1:39 AM
Unknown Object (File)
Apr 21 2024, 11:38 PM
Unknown Object (File)
Apr 21 2024, 11:38 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