Make libsubid more easily usable from C++

C++ requires extern "C" linkage specification to call functions from a C
library. Enclose the function definitions in subid.h in an extern "C"
block if compiling in C++ mode to achieve this.

Signed-off-by: Alois Wohlschlager <alois1@gmx-topmail.de>
This commit is contained in:
Alois Wohlschlager 2022-01-19 11:39:53 +01:00 committed by Serge Hallyn
parent f1f1678e13
commit 9a780cf22b

View File

@ -35,6 +35,10 @@ enum subid_status {
SUBID_STATUS_ERROR = 3,
};
#ifdef __cplusplus
extern "C" {
#endif
/*
* subid_init: initialize libsubid
*
@ -151,5 +155,9 @@ bool subid_ungrant_uid_range(struct subordinate_range *range);
*/
bool subid_ungrant_gid_range(struct subordinate_range *range);
#ifdef __cplusplus
}
#endif
#define SUBID_NFIELDS 3
#endif