Commit abe090ec authored by Max Kellermann's avatar Max Kellermann

*: remove remaining __cplusplus checks

parent dff05c71
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
#define DEFAULT_PLAYLIST_MAX_LENGTH (1024*16) #define DEFAULT_PLAYLIST_MAX_LENGTH (1024*16)
#define DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS false #define DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS false
#ifdef __cplusplus
class Path; class Path;
#endif
void config_global_init(void); void config_global_init(void);
void config_global_finish(void); void config_global_finish(void);
...@@ -43,17 +41,9 @@ void config_global_finish(void); ...@@ -43,17 +41,9 @@ void config_global_finish(void);
*/ */
void config_global_check(void); void config_global_check(void);
#ifdef __cplusplus
bool bool
ReadConfigFile(const Path &path, GError **error_r); ReadConfigFile(const Path &path, GError **error_r);
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* don't free the returned value /* don't free the returned value
set _last_ to NULL to get first entry */ set _last_ to NULL to get first entry */
gcc_pure gcc_pure
...@@ -102,8 +92,4 @@ config_get_positive(enum ConfigOption option, unsigned default_value); ...@@ -102,8 +92,4 @@ config_get_positive(enum ConfigOption option, unsigned default_value);
gcc_pure gcc_pure
bool config_get_bool(enum ConfigOption option, bool default_value); bool config_get_bool(enum ConfigOption option, bool default_value);
#ifdef __cplusplus
}
#endif
#endif #endif
...@@ -82,8 +82,6 @@ db_unlock(void) ...@@ -82,8 +82,6 @@ db_unlock(void)
db_mutex.unlock(); db_mutex.unlock();
} }
#ifdef __cplusplus
class ScopeDatabaseLock { class ScopeDatabaseLock {
public: public:
ScopeDatabaseLock() { ScopeDatabaseLock() {
...@@ -96,5 +94,3 @@ public: ...@@ -96,5 +94,3 @@ public:
}; };
#endif #endif
#endif
...@@ -187,10 +187,6 @@ decoder_plugin_container_scan( const struct decoder_plugin *plugin, ...@@ -187,10 +187,6 @@ decoder_plugin_container_scan( const struct decoder_plugin *plugin,
return plugin->container_scan(pathname, tnum); return plugin->container_scan(pathname, tnum);
} }
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* Does the plugin announce the specified file name suffix? * Does the plugin announce the specified file name suffix?
*/ */
...@@ -205,8 +201,4 @@ bool ...@@ -205,8 +201,4 @@ bool
decoder_plugin_supports_mime_type(const struct decoder_plugin *plugin, decoder_plugin_supports_mime_type(const struct decoder_plugin *plugin,
const char *mime_type); const char *mime_type);
#ifdef __cplusplus
}
#endif
#endif #endif
...@@ -31,10 +31,6 @@ class Mixer; ...@@ -31,10 +31,6 @@ class Mixer;
struct mixer_plugin; struct mixer_plugin;
struct config_param; struct config_param;
#ifdef __cplusplus
extern "C" {
#endif
Mixer * Mixer *
mixer_new(const struct mixer_plugin *plugin, void *ao, mixer_new(const struct mixer_plugin *plugin, void *ao,
const config_param &param, const config_param &param,
...@@ -62,8 +58,4 @@ mixer_get_volume(Mixer *mixer, GError **error_r); ...@@ -62,8 +58,4 @@ mixer_get_volume(Mixer *mixer, GError **error_r);
bool bool
mixer_set_volume(Mixer *mixer, unsigned volume, GError **error_r); mixer_set_volume(Mixer *mixer, unsigned volume, GError **error_r);
#ifdef __cplusplus
}
#endif
#endif #endif
...@@ -39,8 +39,6 @@ extern bool playlist_saveAbsolutePaths; ...@@ -39,8 +39,6 @@ extern bool playlist_saveAbsolutePaths;
void void
spl_global_init(void); spl_global_init(void);
#ifdef __cplusplus
/** /**
* Determines whether the specified string is a valid name for a * Determines whether the specified string is a valid name for a
* stored playlist. * stored playlist.
...@@ -81,5 +79,3 @@ bool ...@@ -81,5 +79,3 @@ bool
spl_rename(const char *utf8from, const char *utf8to, GError **error_r); spl_rename(const char *utf8from, const char *utf8to, GError **error_r);
#endif #endif
#endif
...@@ -26,10 +26,6 @@ struct PulseMixer; ...@@ -26,10 +26,6 @@ struct PulseMixer;
struct pa_context; struct pa_context;
struct pa_stream; struct pa_stream;
#ifdef __cplusplus
extern "C" {
#endif
void void
pulse_mixer_on_connect(PulseMixer *pm, struct pa_context *context); pulse_mixer_on_connect(PulseMixer *pm, struct pa_context *context);
...@@ -40,8 +36,4 @@ void ...@@ -40,8 +36,4 @@ void
pulse_mixer_on_change(PulseMixer *pm, pulse_mixer_on_change(PulseMixer *pm,
struct pa_context *context, struct pa_stream *stream); struct pa_context *context, struct pa_stream *stream);
#ifdef __cplusplus
}
#endif
#endif #endif
...@@ -28,10 +28,6 @@ struct pa_cvolume; ...@@ -28,10 +28,6 @@ struct pa_cvolume;
extern const struct audio_output_plugin pulse_output_plugin; extern const struct audio_output_plugin pulse_output_plugin;
#ifdef __cplusplus
extern "C" {
#endif
void void
pulse_output_lock(PulseOutput *po); pulse_output_lock(PulseOutput *po);
...@@ -48,8 +44,4 @@ bool ...@@ -48,8 +44,4 @@ bool
pulse_output_set_volume(PulseOutput *po, pulse_output_set_volume(PulseOutput *po,
const struct pa_cvolume *volume, GError **error_r); const struct pa_cvolume *volume, GError **error_r);
#ifdef __cplusplus
}
#endif
#endif #endif
...@@ -23,28 +23,6 @@ ...@@ -23,28 +23,6 @@
#include "gcc.h" #include "gcc.h"
/** /**
* Remove the "const" attribute from a string pointer. This is a
* dirty hack, don't use it unless you know what you're doing!
*/
gcc_const
static inline char *
deconst_string(const char *p)
{
#ifdef __cplusplus
return const_cast<char *>(p);
#else
union {
const char *in;
char *out;
} u = {
.in = p,
};
return u.out;
#endif
}
/**
* Returns a pointer to the first non-whitespace character in the * Returns a pointer to the first non-whitespace character in the
* string, or to the end of the string. * string, or to the end of the string.
* *
...@@ -62,7 +40,7 @@ gcc_pure ...@@ -62,7 +40,7 @@ gcc_pure
static inline char * static inline char *
strchug_fast(char *p) strchug_fast(char *p)
{ {
return deconst_string(strchug_fast_c(p)); return const_cast<char *>(strchug_fast_c(p));
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment