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