-#if defined(__WXMSW__)
-#include "wx/msw/wave.h"
-#elif defined(__WXGTK__)
-#include "wx/unix/wave.h"
-#elif defined(__WXX11__)
-#include "wx/unix/wave.h"
-#elif defined(__WXMOTIF__)
-#include "wx/unix/wave.h"
-#elif defined(__WXMAC__)
-#include "wx/mac/wave.h"
-#elif defined(__WXPM__)
-#include "wx/os2/wave.h"
+#include "wx/defs.h"
+
+#if wxUSE_SOUND
+
+#if WXWIN_COMPATIBILITY_2_4
+#if defined(__DMC__) || defined(__BORLANDC__)
+ #pragma message "wx/wave.h header is deprecated, use wx/sound.h and wxSound"
+#elif defined(__WATCOMC__) || defined(__VISUALC__)
+ #pragma message ("wx/wave.h header is deprecated, use wx/sound.h and wxSound")
+#else
+ #warning "wx/wave.h header is deprecated, use wx/sound.h and wxSound"
+#endif
+ #include "wx/sound.h"
+ // wxSound used to be called wxWave before wxWidgets 2.5.1:
+ typedef wxSound wxWave;
+#else
+ #error "wx/wave.h is only available in compatibility mode"
+#endif
+