KevinTsui1234 / tint2

Automatically exported from code.google.com/p/tint2
GNU General Public License v2.0
1 stars 0 forks source link

In r652 build fails when battery applet is disabled #428

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Steps to reproduce:
1. in CMakeList.txt change line 63 to: option( ENABLE_BATTERY "Enable battery 
status plugin" OFF ) 
2. cmake -DCMAKE_INSTALL_PREFIX=/usr ./
3. make

Runs into this error:
/home/ondra/tint2-read-only/src/config.c:680:4: error: ‘battery_enabled’ 
undeclared (first use in this function)

This happens when building sources from r652 trunk, on Gentoo Linux 3.5.7, gcc 
4.6.3, cmake 2.8.9

I suppose this patch should do the thing (don't know if this don't breaks any 
of your coding policy):

--- src/config_old.c    2013-01-20 16:54:29.505188612 +0100
+++ src/config.c    2013-01-20 16:56:15.678189495 +0100
@@ -51,6 +51,8 @@

 #ifdef ENABLE_BATTERY
 #include "battery.h"
+#else
+int battery_enabled = 0;
 #endif

 // global path

Original issue reported on code.google.com by ondrej.k...@gmail.com on 20 Jan 2013 at 4:09

GoogleCodeExporter commented 8 years ago
sorry for not very beautiful patch, this one should be better (it omits 
checking for battery configuration instead of adding battery_enabled variable 
when the battery applet is disabled).

Original comment by ondrej.k...@gmail.com on 20 Jan 2013 at 6:21

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by mrovi9...@gmail.com on 1 Feb 2015 at 6:35

GoogleCodeExporter commented 8 years ago

Original comment by mrovi9...@gmail.com on 1 Feb 2015 at 11:50

GoogleCodeExporter commented 8 years ago
Thanks! Fixed in r684.

Original comment by mrovi9...@gmail.com on 4 Feb 2015 at 10:32