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)
Dec 4 2024, 1:11 AM
Unknown Object (File)
Dec 4 2024, 1:03 AM
Unknown Object (File)
Dec 3 2024, 12:35 AM
Unknown Object (File)
Dec 2 2024, 2:25 AM
Unknown Object (File)
Dec 1 2024, 1:49 AM
Unknown Object (File)
Nov 15 2024, 7:58 AM
Unknown Object (File)
Nov 6 2024, 6:31 PM
Unknown Object (File)
Oct 22 2024, 5:01 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