diff --git a/src/helpers.cpp b/src/helpers.cpp index 35824e74..e7c83183 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -18,6 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include #include #include "helpers.h" diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 52894ce0..8c451c69 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -18,7 +18,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include + +#include #include +#include #include "mpdpp.h" #include "ncmpcpp.h" diff --git a/src/ncmpcpp.h b/src/ncmpcpp.h index 61f3a1cb..3c6c9782 100644 --- a/src/ncmpcpp.h +++ b/src/ncmpcpp.h @@ -21,22 +21,6 @@ #ifndef HAVE_NCMPCPP_H #define HAVE_NCMPCPP_H -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef UTF8_ENABLED -# define UNICODE 1 -#else -# define UNICODE 0 -#endif - -#include -#include -#include -#include -#include - #include "window.h" #include "menu.h" #include "scrollpad.h" diff --git a/src/scrollpad.cpp b/src/scrollpad.cpp index f5f7923d..58d918e9 100644 --- a/src/scrollpad.cpp +++ b/src/scrollpad.cpp @@ -36,13 +36,13 @@ void Scrollpad::Add(string str) itsRawContent += str; -#ifdef UTF8_ENABLED +# ifdef UTF8_ENABLED wstring s = ToWString(str); wstring tmp; -#else +# else string &s = str; string tmp; -#endif +# endif int x_pos = 0; int space_pos = 0; diff --git a/src/window.h b/src/window.h index 3df4f5b4..c39baa27 100644 --- a/src/window.h +++ b/src/window.h @@ -21,6 +21,10 @@ #ifndef HAVE_WINDOW_H #define HAVE_WINDOW_H +#ifdef HAVE_CONFIG_H +#include +#endif + #include "ncurses.h" #include @@ -30,10 +34,12 @@ #include #ifdef UTF8_ENABLED +# define UNICODE 1 # define my_string_t wstring # define TO_STRING(x) ToString(x) # define TO_WSTRING(x) ToWString(x) #else +# define UNICODE 0 # define my_string_t string # define TO_STRING(x) x # define TO_WSTRING(x) x @@ -91,12 +97,12 @@ class Window virtual void Write(int, const string &, bool = 0); virtual void WriteXY(int x, int y, const string &s, bool ete = 0) { WriteXY(x, y, 0xFFFF, s, ete); } virtual void WriteXY(int, int, int, const string &, bool = 0); -#ifdef UTF8_ENABLED +# ifdef UTF8_ENABLED virtual void Write(const wstring &s, bool cte = 0) { Write(0xFFFF, s, cte); } virtual void Write(int, const wstring &, bool = 0); virtual void WriteXY(int x, int y, const wstring &s, bool ete = 0) { WriteXY(x, y, 0xFFFF, s, ete); } virtual void WriteXY(int, int, int, const wstring &, bool = 0); -#endif +# endif virtual string GetString(const string &, unsigned int = -1, int = 0) const; virtual string GetString(unsigned int length = -1, int width = 0) const { return GetString("", length, width); } virtual void Scrollable(bool) const;