diff --git a/Makefile.am b/Makefile.am
index e3cfd9d89..eca519b01 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,8 +62,6 @@ mpd_headers = \
 	src/open.h \
 	src/Playlist.hxx \
 	src/poison.h \
-	src/replay_gain_config.h \
-	src/replay_gain_info.h \
 	src/TimePrint.cxx src/TimePrint.hxx \
 	src/Timer.hxx
 
@@ -192,8 +190,8 @@ src_mpd_SOURCES = \
 	src/Queue.cxx src/Queue.hxx \
 	src/QueuePrint.cxx src/QueuePrint.hxx \
 	src/QueueSave.cxx src/QueueSave.hxx \
-	src/ReplayGainConfig.cxx \
-	src/ReplayGainInfo.cxx \
+	src/ReplayGainConfig.cxx src/ReplayGainConfig.hxx \
+	src/ReplayGainInfo.cxx src/ReplayGainInfo.hxx \
 	src/SignalHandlers.cxx src/SignalHandlers.hxx \
 	src/Song.cxx src/Song.hxx \
 	src/SongUpdate.cxx \
diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx
index 3f38a0b5e..f7716a584 100644
--- a/src/DecoderAPI.cxx
+++ b/src/DecoderAPI.cxx
@@ -21,7 +21,7 @@
 #include "DecoderAPI.hxx"
 #include "DecoderError.hxx"
 #include "AudioConfig.hxx"
-#include "replay_gain_config.h"
+#include "ReplayGainConfig.hxx"
 #include "MusicChunk.hxx"
 #include "MusicBuffer.hxx"
 #include "MusicPipe.hxx"
diff --git a/src/DecoderAPI.hxx b/src/DecoderAPI.hxx
index f96aa596a..8bd38545f 100644
--- a/src/DecoderAPI.hxx
+++ b/src/DecoderAPI.hxx
@@ -30,7 +30,7 @@
 #include "check.h"
 #include "DecoderCommand.hxx"
 #include "DecoderPlugin.hxx"
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 #include "tag/Tag.hxx"
 #include "AudioFormat.hxx"
 #include "ConfigData.hxx"
diff --git a/src/DecoderInternal.hxx b/src/DecoderInternal.hxx
index 3715ef427..5e0570c62 100644
--- a/src/DecoderInternal.hxx
+++ b/src/DecoderInternal.hxx
@@ -22,7 +22,7 @@
 
 #include "DecoderCommand.hxx"
 #include "pcm/PcmConvert.hxx"
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 
 struct input_stream;
 struct Tag;
diff --git a/src/Main.cxx b/src/Main.cxx
index 6857970cf..8509abcfb 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -39,7 +39,7 @@
 #include "Volume.hxx"
 #include "OutputAll.hxx"
 #include "tag/TagConfig.hxx"
-#include "replay_gain_config.h"
+#include "ReplayGainConfig.hxx"
 #include "Idle.hxx"
 #include "SignalHandlers.hxx"
 #include "Log.hxx"
diff --git a/src/MusicChunk.hxx b/src/MusicChunk.hxx
index a35684a1d..3365b0bea 100644
--- a/src/MusicChunk.hxx
+++ b/src/MusicChunk.hxx
@@ -20,7 +20,7 @@
 #ifndef MPD_MUSIC_CHUNK_HXX
 #define MPD_MUSIC_CHUNK_HXX
 
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 
 #ifndef NDEBUG
 #include "AudioFormat.hxx"
diff --git a/src/OutputAll.hxx b/src/OutputAll.hxx
index a01109e56..7053c0580 100644
--- a/src/OutputAll.hxx
+++ b/src/OutputAll.hxx
@@ -26,7 +26,7 @@
 #ifndef OUTPUT_ALL_H
 #define OUTPUT_ALL_H
 
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 #include "gcc.h"
 
 struct AudioFormat;
diff --git a/src/OutputControl.hxx b/src/OutputControl.hxx
index 165afb28c..25fbec1e7 100644
--- a/src/OutputControl.hxx
+++ b/src/OutputControl.hxx
@@ -20,7 +20,7 @@
 #ifndef MPD_OUTPUT_CONTROL_HXX
 #define MPD_OUTPUT_CONTROL_HXX
 
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 
 #include <stddef.h>
 
diff --git a/src/PlayerCommands.cxx b/src/PlayerCommands.cxx
index b9f6c7446..1a2580ee3 100644
--- a/src/PlayerCommands.cxx
+++ b/src/PlayerCommands.cxx
@@ -29,14 +29,8 @@
 #include "Partition.hxx"
 #include "protocol/Result.hxx"
 #include "protocol/ArgParser.hxx"
-
-extern "C" {
 #include "AudioFormat.hxx"
-}
-
-#include "replay_gain_config.h"
-
-#include <errno.h>
+#include "ReplayGainConfig.hxx"
 
 #define COMMAND_STATUS_STATE            "state"
 #define COMMAND_STATUS_REPEAT           "repeat"
diff --git a/src/ReplayGainConfig.cxx b/src/ReplayGainConfig.cxx
index 3442628b3..9665c8fcf 100644
--- a/src/ReplayGainConfig.cxx
+++ b/src/ReplayGainConfig.cxx
@@ -18,7 +18,7 @@
  */
 
 #include "config.h"
-#include "replay_gain_config.h"
+#include "ReplayGainConfig.hxx"
 #include "Idle.hxx"
 #include "ConfigData.hxx"
 #include "ConfigGlobal.hxx"
diff --git a/src/replay_gain_config.h b/src/ReplayGainConfig.hxx
similarity index 85%
rename from src/replay_gain_config.h
rename to src/ReplayGainConfig.hxx
index 4b59334c0..5b81d1cc1 100644
--- a/src/replay_gain_config.h
+++ b/src/ReplayGainConfig.hxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
  * http://www.musicpd.org
  *
  * This program is free software; you can redistribute it and/or modify
@@ -17,23 +17,17 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#ifndef MPD_REPLAY_GAIN_CONFIG_H
-#define MPD_REPLAY_GAIN_CONFIG_H
+#ifndef MPD_REPLAY_GAIN_CONFIG_HXX
+#define MPD_REPLAY_GAIN_CONFIG_HXX
 
 #include "check.h"
-#include "replay_gain_info.h"
-
-#include <stdbool.h>
+#include "ReplayGainInfo.hxx"
 
 extern enum replay_gain_mode replay_gain_mode;
 extern float replay_gain_preamp;
 extern float replay_gain_missing_preamp;
 extern bool replay_gain_limit;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 void replay_gain_global_init(void);
 
 /**
@@ -56,8 +50,4 @@ replay_gain_set_mode_string(const char *p);
 enum replay_gain_mode
 replay_gain_get_real_mode(bool random_mode);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
diff --git a/src/ReplayGainInfo.cxx b/src/ReplayGainInfo.cxx
index b9d1b82c6..ac1c13822 100644
--- a/src/ReplayGainInfo.cxx
+++ b/src/ReplayGainInfo.cxx
@@ -18,7 +18,7 @@
  */
 
 #include "config.h"
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 
 float
 replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp, float missing_preamp, bool peak_limit)
diff --git a/src/replay_gain_info.h b/src/ReplayGainInfo.hxx
similarity index 84%
rename from src/replay_gain_info.h
rename to src/ReplayGainInfo.hxx
index b06dc6cf0..bfc5f68a7 100644
--- a/src/replay_gain_info.h
+++ b/src/ReplayGainInfo.hxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
  * http://www.musicpd.org
  *
  * This program is free software; you can redistribute it and/or modify
@@ -17,17 +17,12 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#ifndef MPD_REPLAY_GAIN_INFO_H
-#define MPD_REPLAY_GAIN_INFO_H
+#ifndef MPD_REPLAY_GAIN_INFO_HXX
+#define MPD_REPLAY_GAIN_INFO_HXX
 
 #include "check.h"
 
-#ifdef __cplusplus
 #include <cmath>
-#else
-#include <stdbool.h>
-#include <math.h>
-#endif
 
 enum replay_gain_mode {
 	REPLAY_GAIN_AUTO = -2,
@@ -62,17 +57,9 @@ replay_gain_info_init(struct replay_gain_info *info)
 static inline bool
 replay_gain_tuple_defined(const struct replay_gain_tuple *tuple)
 {
-#ifdef __cplusplus
 	return !std::isinf(tuple->gain);
-#else
-	return !isinf(tuple->gain);
-#endif
 }
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 float
 replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp, float missing_preamp, bool peak_limit);
 
@@ -83,8 +70,4 @@ replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp, flo
 void
 replay_gain_info_complete(struct replay_gain_info *info);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
diff --git a/src/decoder/FlacMetadata.cxx b/src/decoder/FlacMetadata.cxx
index 49e4851e8..078d0c081 100644
--- a/src/decoder/FlacMetadata.cxx
+++ b/src/decoder/FlacMetadata.cxx
@@ -24,7 +24,7 @@
 #include "tag/TagHandler.hxx"
 #include "tag/TagTable.hxx"
 #include "tag/TagBuilder.hxx"
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 
 #include <glib.h>
 
diff --git a/src/decoder/VorbisComments.cxx b/src/decoder/VorbisComments.cxx
index c8eeb09cd..402ee7c2b 100644
--- a/src/decoder/VorbisComments.cxx
+++ b/src/decoder/VorbisComments.cxx
@@ -24,9 +24,10 @@
 #include "tag/TagTable.hxx"
 #include "tag/TagHandler.hxx"
 #include "tag/TagBuilder.hxx"
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 
 #include <glib.h>
+
 #include <assert.h>
 #include <stddef.h>
 #include <string.h>
diff --git a/src/filter/ReplayGainFilterPlugin.cxx b/src/filter/ReplayGainFilterPlugin.cxx
index d22a5232e..5ac9840b1 100644
--- a/src/filter/ReplayGainFilterPlugin.cxx
+++ b/src/filter/ReplayGainFilterPlugin.cxx
@@ -23,8 +23,8 @@
 #include "FilterInternal.hxx"
 #include "FilterRegistry.hxx"
 #include "AudioFormat.hxx"
-#include "replay_gain_info.h"
-#include "replay_gain_config.h"
+#include "ReplayGainInfo.hxx"
+#include "ReplayGainConfig.hxx"
 #include "MixerControl.hxx"
 #include "pcm/PcmVolume.hxx"
 #include "pcm/PcmBuffer.hxx"
diff --git a/src/filter/ReplayGainFilterPlugin.hxx b/src/filter/ReplayGainFilterPlugin.hxx
index 06b778f8f..89cbe6c96 100644
--- a/src/filter/ReplayGainFilterPlugin.hxx
+++ b/src/filter/ReplayGainFilterPlugin.hxx
@@ -20,7 +20,7 @@
 #ifndef MPD_REPLAY_GAIN_FILTER_PLUGIN_HXX
 #define MPD_REPLAY_GAIN_FILTER_PLUGIN_HXX
 
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 
 class Filter;
 class Mixer;
diff --git a/src/tag/ApeReplayGain.cxx b/src/tag/ApeReplayGain.cxx
index 0135d1b61..817eca349 100644
--- a/src/tag/ApeReplayGain.cxx
+++ b/src/tag/ApeReplayGain.cxx
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "ApeReplayGain.hxx"
 #include "ApeLoader.hxx"
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 
 #include <glib.h>
 
diff --git a/src/tag/TagRva2.cxx b/src/tag/TagRva2.cxx
index f41119c35..071e3a443 100644
--- a/src/tag/TagRva2.cxx
+++ b/src/tag/TagRva2.cxx
@@ -19,7 +19,7 @@
 
 #include "config.h"
 #include "TagRva2.hxx"
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 
 #include <stdint.h>
 #include <string.h>
diff --git a/test/FakeReplayGainConfig.cxx b/test/FakeReplayGainConfig.cxx
index 9c2431bf2..3305b79a3 100644
--- a/test/FakeReplayGainConfig.cxx
+++ b/test/FakeReplayGainConfig.cxx
@@ -18,7 +18,7 @@
  */
 
 #include "config.h"
-#include "replay_gain_config.h"
+#include "ReplayGainConfig.hxx"
 
 float replay_gain_preamp = 1.0;
 float replay_gain_missing_preamp = 1.0;
diff --git a/test/dump_rva2.cxx b/test/dump_rva2.cxx
index bbc6f471a..3206f970a 100644
--- a/test/dump_rva2.cxx
+++ b/test/dump_rva2.cxx
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "tag/TagId3.hxx"
 #include "tag/TagRva2.hxx"
-#include "replay_gain_info.h"
+#include "ReplayGainInfo.hxx"
 #include "ConfigGlobal.hxx"
 #include "util/Error.hxx"