branch Attitude Adjustment packages
[12.09/packages.git] / utils / bemused / patches / 200-cxx-compile-fixes.patch
1 Index: bemused-mpd-r062/Makefile
2 ===================================================================
3 --- bemused-mpd-r062.orig/Makefile      2008-03-31 09:43:54.000000000 +0200
4 +++ bemused-mpd-r062/Makefile   2011-03-06 14:19:07.933096517 +0100
5 @@ -1,8 +1,15 @@
6 -SHELL = /bin/sh
7 +LDLIBS = -lbluetooth -lglib -liconv
8 +CPPFLAGS = -I/usr/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I./
9 +CFLAGS = -Os
10 +CXXFLAGS = -Os
11  
12 -#optimized for openwrt use! mylibs should be -lbluetooth, liconv and -lglib
13 -MYLIBS = -lbluetooth -lglib -liconv
14 -INCL = -I/usr/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I./
15 +%.o: %.c
16 +       $(CC) -c $(CFLAGS) $(CPPFLAGS) $^ -o $@
17  
18 -bemusedlinuxserver:    main.cpp BemusedServerDlg.cpp mpdctrl.c
19 -                       $(CXX) -Os -o bemusedlinuxserver $(INCL) $(LDFLAGS) $(MYLIBS) main.cpp BemusedServerDlg.cpp mpdctrl.c libmpdclient.c
20 +%.o: %.cpp
21 +       $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $^ -o $@
22 +
23 +bemusedlinuxserver: main.o BemusedServerDlg.o mpdctrl.o libmpdclient.o
24 +       $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
25 +
26 +all: bemusedlinuxserver
27 Index: bemused-mpd-r062/libmpdclient.h
28 ===================================================================
29 --- bemused-mpd-r062.orig/libmpdclient.h        2008-04-28 23:03:52.000000000 +0200
30 +++ bemused-mpd-r062/libmpdclient.h     2011-03-06 14:15:34.821307043 +0100
31 @@ -68,11 +68,10 @@
32  #define MPD_ACK_ERROR_EXIST                    56
33  
34  #include <stdlib.h>
35 -#include <iostream>
36  
37 -//#ifdef __cplusplus
38 -//extern "C" {
39 -//#endif
40 +#ifdef __cplusplus
41 +extern "C" {
42 +#endif
43  
44  typedef enum mpd_TagItems {
45      MPD_TAG_ITEM_ARTIST,
46 @@ -654,8 +653,8 @@ void mpd_sendPlaylistAddCommand(mpd_Conn
47  void mpd_sendPlaylistMoveCommand(mpd_Connection * connection, char *playlist, int from, int to);
48  
49  void mpd_sendPlaylistDeleteCommand(mpd_Connection * connection, char *playlist, int pos);
50 -//#ifdef __cplusplus
51 -//}
52 -//#endif
53 +#ifdef __cplusplus
54 +}
55 +#endif
56  
57  #endif
58 Index: bemused-mpd-r062/mpdctrl.c
59 ===================================================================
60 --- bemused-mpd-r062.orig/mpdctrl.c     2008-04-28 23:03:52.000000000 +0200
61 +++ bemused-mpd-r062/mpdctrl.c  2011-03-06 14:15:34.821307043 +0100
62 @@ -59,6 +59,9 @@
63  
64  #define ERROR_DISPLAY 5
65  
66 +#define false  0
67 +#define true   (!false)
68 +
69  static int l_totalTimeSec;
70  static int l_elapsedTimeSec;
71  static int l_bitRate;