From ee99f213b29297b1016bc6210c16085c0b3068de Mon Sep 17 00:00:00 2001 From: John Grossman Date: Wed, 13 Jul 2011 16:21:11 -0700 Subject: include: make it easier to use this header from C++ Add a extern "C" controlled by an #ifdef __cplusplus directive so that this header can be included from C++ code without having to explicitly control the linkage. --- include/tinyalsa/asoundlib.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h index 7b13c0d..8395766 100644 --- a/include/tinyalsa/asoundlib.h +++ b/include/tinyalsa/asoundlib.h @@ -31,6 +31,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + /* * PCM API */ @@ -149,4 +153,8 @@ int mixer_ctl_set_enum_by_string(struct mixer_ctl *ctl, const char *string); int mixer_ctl_get_range_min(struct mixer_ctl *ctl); int mixer_ctl_get_range_max(struct mixer_ctl *ctl); +#if defined(__cplusplus) +} /* extern "C" */ +#endif + #endif -- cgit v1.2.3