bugGNU source-highlight - Bugs: bug #39358, configure, c++11: two patches to...

 
 

bug #39358: configure, c++11: two patches to allow building

Submitted by:  Anton Bachin <antonbachin>
Submitted on:  Fri 28 Jun 2013 02:46:26 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Lorenzo Bettini <bettini>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 27 Mar 2015 04:40:21 PM UTC, comment #1:

sorry for the late reply.
I've applied the patch, it will be part of the next release

Lorenzo Bettini <bettini>
Project AdministratorIn charge of this item.
Fri 28 Jun 2013 02:46:26 PM UTC, original submission:

Hello,

I've had to make two patches to get source-highlight to build on my system (Max OS X 10.8, clang 3.1, C++11 mode).

1. During the configure process, a check is run for stdbool.h and _Bool with the language set to C++, so the check fails. The first patch surrounds the gnulib macro call with AC_LANG_PUSH/POP to run this check, and all other gnulib checks, in C mode.

--- a/configure.ac
+++ b/configure.ac
@@ -160,7 +160,9 @@ AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)

# For gnulib.
+AC_LANG_PUSH([C])
gl_INIT
+AC_LANG_POP([C])

dnl needed by readtags.c
AC_TYPE_OFF_T

2. lib/srchilite/settings.cpp compares std::ifstream objects with zero. This worked under C++98 because ifstream had an implicit converting operator to void*. This has been replaced with an explicit conversion to bool in C++11. I replaced the comparisons with a call to fail() instead, since this is compatible with both C++98 and C++11, and is what both conversions rely on internally.

--- a/lib/srchilite/settings.cpp
+++ b/lib/srchilite/settings.cpp
@@ -94,14 +94,14 @@ bool Settings::checkForTestFile() {
string file = dataDir + "/" + testFileName;
ifstream i(file.c_str());

- return (i != 0);
+ return (!i.fail());
}

bool Settings::checkForConfFile() {
string file = confDir + confFileName;
ifstream i(file.c_str());

- return (i != 0);
+ return (!i.fail());
}

bool Settings::readDataDir() {
@@ -109,7 +109,7 @@ bool Settings::readDataDir() {
ifstream i(file.c_str());

string line;
- if (i != 0) {
+ if (!i.fail()) {
while (read_line(&i, line)) {
if (line.size()) {
boost::cmatch what;

Anton Bachin <antonbachin>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #28442:  configure-c++11.patch added by antonbachin (1KiB - application/octet-stream - Attached the patch as a text file since the description field seems to remove whitespace.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bettini (Posted a comment)
  • -unavailable- added by antonbachin (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 27 Mar 2015 04:40:55 PM UTCbettiniOpen/ClosedOpen=>Closed
    Fri 27 Mar 2015 04:40:21 PM UTCbettiniStatusNone=>Fixed
      Assigned toNone=>bettini
    Fri 28 Jun 2013 02:49:44 PM UTCantonbachinAttached File-=>Added configure-c++11.patch, #28442

    Back to the top


    Powered by Savane 3.1-cleanup1