summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Lehtimäki <matti.lehtimaki@gmail.com>2012-05-06 23:46:40 +0300
committerMatti Lehtimäki <matti.lehtimaki@gmail.com>2012-05-06 23:46:40 +0300
commit548e0a6bc35d4c776039f7467c0d67eabf9ef46a (patch)
treeff9ecf6914accab0ee64793672cbdc5aeefa01d1
parent61b085f1d12ef86807f779f57671fa1e7a5a14c0 (diff)
downloadvdr-plugin-epgfixer-548e0a6bc35d4c776039f7467c0d67eabf9ef46a.tar.gz
vdr-plugin-epgfixer-548e0a6bc35d4c776039f7467c0d67eabf9ef46a.tar.bz2
Fix compiling with g++-4.7. Fix and improve Makefile.
-rw-r--r--Makefile10
-rw-r--r--epgfixer.c8
-rw-r--r--tools.h2
3 files changed, 14 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 95aa908..90871de 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,8 @@ PLUGIN = epgfixer
### The version number of this plugin (taken from the main source file):
-VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
+VERSION = $(shell grep 'static const char VERSION\[\] *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
+GITTAG = $(shell git describe --always 2>/dev/null)
### The C++ compiler and options:
@@ -55,6 +56,10 @@ INCLUDES += -I$(VDRDIR)/include
DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+ifneq ($(strip $(GITTAG)),)
+DEFINES += -DGITVERSION='"-GIT-$(GITTAG)"'
+endif
+
### The object files (add further files here):
OBJS = $(PLUGIN).o charset.o config.o epghandler.o regexp.o setup_menu.o tools.o
@@ -126,5 +131,4 @@ clean:
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
cppcheck: $(OBJS)
- @cppcheck --enable=information,style,unusedFunction -v -f $(OBJS:%.o=%.c)
-
+ @cppcheck --enable=information,style,unusedFunction -v -f $(OBJS:%.o=%.c)
diff --git a/epgfixer.c b/epgfixer.c
index 04bb987..7308b0c 100644
--- a/epgfixer.c
+++ b/epgfixer.c
@@ -16,8 +16,12 @@
#error "VDR-1.7.26 API version or greater is required!"
#endif
-static const char *VERSION = "0.1.0";
-static const char *DESCRIPTION = trNOOP("Fix bugs in EPG");
+#ifndef GITVERSION
+#define GITVERSION ""
+#endif
+
+static const char VERSION[] = "0.1.0" GITVERSION;
+static const char DESCRIPTION[] = trNOOP("Fix bugs in EPG");
class cPluginEpgfixer : public cPlugin {
private:
diff --git a/tools.h b/tools.h
index dfcee30..bf49fac 100644
--- a/tools.h
+++ b/tools.h
@@ -57,7 +57,7 @@ protected:
cReadLine ReadLine;
while ((s = ReadLine.Read(f)) != NULL) {
if (!isempty(s)) {
- Add(new T());
+ this->Add(new T());
cList<T>::Last()->SetFromString(s, true);
}
}