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
F170723231: D37946.id114814.diff
Sun, Sep 6, 5:38 AM
F170686840: D37946.id114814.diff
Sun, Sep 6, 12:55 AM
F170541032: D37946.id114756.diff
Sat, Sep 5, 7:56 AM
Unknown Object (File)
Sat, Sep 5, 12:20 AM
Unknown Object (File)
Fri, Sep 4, 10:38 PM
Unknown Object (File)
Fri, Sep 4, 5:42 PM
Unknown Object (File)
Fri, Sep 4, 1:08 PM
Unknown Object (File)
Thu, Sep 3, 5:56 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