libtabula

Check-in [9069ab8ffb]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added another C++11 test using the same mechanism from the previous one, this time for the cbegin/cend iterators, required on EL7, but which break the build on EL5's default GCC 4.1.2 compiler. Now we use them if present, and not if not.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9069ab8ffbea51b3d72b3c5d97c18d129a70c462
User & Date: etr 2015-09-11 18:41:37
Context
2015-09-11
18:47
Moved the configure_file() calls to the bottom of the top-level CMakeLists.txt file so they're after the recently-added C++11 tests. Otherwise, the wrong values get stored in src/config.h, and it can toggle on you, too. check-in: 650133871e user: etr tags: trunk
18:41
Added another C++11 test using the same mechanism from the previous one, this time for the cbegin/cend iterators, required on EL7, but which break the build on EL5's default GCC 4.1.2 compiler. Now we use them if present, and not if not. check-in: 9069ab8ffb user: etr tags: trunk
18:30
Added a test for C++11's "long long" data type, which we use in defining sql_* data types. Previously, we blindly assumed the C++ compiler also supported C99's "long long" even though C++98 and C++03 don't require it, which in turn required a couple of levels of fall-back for the cases where the C++ compiler didn't have that extension. Now that it's finally part of C++, we can just check for it. check-in: dd77d4c60e user: etr tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to CMakeLists.txt.

146
147
148
149
150
151
152

153
154
155
156
157
158
159
add_subdirectory(src/ssx)
add_subdirectory(test)
add_subdirectory(examples)

# Check for specific post-C++98 features.  Must be after cmake subdir.
include(cmake/CheckCXX11Features.cmake)
CXX_CHECK_FEATURE("long long" HAVE_CXX_LONG_LONG)


# Two testing targets based on the dtest script, one running it
# standalone, one under CTest.  The latter suppresses output and 
# only reports pass/fail.  The dtest target can't depend on "all"
# due to a CMake design weakness, while "test" does implicitly,
# since it's integrated into the CMake design.
add_custom_target(dtest







>







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
add_subdirectory(src/ssx)
add_subdirectory(test)
add_subdirectory(examples)

# Check for specific post-C++98 features.  Must be after cmake subdir.
include(cmake/CheckCXX11Features.cmake)
CXX_CHECK_FEATURE("long long" HAVE_CXX_LONG_LONG)
CXX_CHECK_FEATURE("cbegin and cend" HAVE_CXX_CBEGIN_CEND)

# Two testing targets based on the dtest script, one running it
# standalone, one under CTest.  The latter suppresses output and 
# only reports pass/fail.  The dtest target can't depend on "all"
# due to a CMake design weakness, while "test" does implicitly,
# since it's integrated into the CMake design.
add_custom_target(dtest

Added cmake/c++-test-cbegin_and_cend.cpp.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
#include <vector>

int main(void)
{
	std::vector<int> v;
	std::vector<int>::const_iterator it = v.cbegin();
	return it == v.cend() ? 0 : 1;
}

Changes to src/config.h.in.

1
2
3
4



#cmakedefine HAVE_POSIX_GETOPT
#cmakedefine HAVE_LIBIBERTY_GETOPT

#cmakedefine HAVE_LOCALTIME_R







>
>
>
1
2
3
4
5
6
7
#cmakedefine HAVE_POSIX_GETOPT
#cmakedefine HAVE_LIBIBERTY_GETOPT

#cmakedefine HAVE_LOCALTIME_R

#cmakedefine HAVE_CXX_LONG_LONG
#cmakedefine HAVE_CXX_CBEGIN_CEND

Changes to src/row.cpp.

1
2
3

4

5

6
7
8
9
10
11
12
13
14
...
164
165
166
167
168
169
170

171
172




173
174
175
176
177
178
179
/***********************************************************************
 row.cpp - Implements the Row class.


 Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and

 © 2004-2007 by Educational Technology Resources, Inc.  Others may

 also hold copyrights on code in this file.  See the CREDITS.md file
 in the top directory of the distribution for details.

 This file is part of libtabula.

 libtabula is free software; you can redistribute it and/or modify it
 under the terms of the GNU Lesser General Public License as published
 by the Free Software Foundation; either version 2.1 of the License, or
 (at your option) any later version.
................................................................................


Row&
Row::operator =(const Row& rhs)
{
	data_->assign(rhs.data_->begin(), rhs.data_->end());
	field_names_->clear();

	copy(rhs.field_names_->cbegin(), rhs.field_names_->cend(),
			field_names_->begin());




	initialized_ = rhs.initialized_;
	return *this;
}


const Row::value_type&
Row::operator [](const char* field) const



>
|
>
|
>
|
|







 







>


>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/***********************************************************************
 row.cpp - Implements the Row class.

 Copyright
   © 1998 by Kevin Atkinson
   © 1999-2001 by MySQL AB
   © 2004-2007, 2015 by Educational Technology Resources, Inc. 
   
 Others may also hold copyrights on code in this file.  See the
 CREDITS.md file in the top directory of the distribution for details.

 This file is part of libtabula.

 libtabula is free software; you can redistribute it and/or modify it
 under the terms of the GNU Lesser General Public License as published
 by the Free Software Foundation; either version 2.1 of the License, or
 (at your option) any later version.
................................................................................


Row&
Row::operator =(const Row& rhs)
{
	data_->assign(rhs.data_->begin(), rhs.data_->end());
	field_names_->clear();
#if defined(HAVE_CXX_CBEGIN_CEND)
	copy(rhs.field_names_->cbegin(), rhs.field_names_->cend(),
			field_names_->begin());
#else
	copy(rhs.field_names_->begin(), rhs.field_names_->end(),
			field_names_->begin());
#endif
	initialized_ = rhs.initialized_;
	return *this;
}


const Row::value_type&
Row::operator [](const char* field) const