libtabula

Check-in [169bdfd29a]
Login

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

Overview
Comment:Added <tr1/cstdint> alternative between <cstdint> and <boost/cstdint.hpp>
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 169bdfd29ada43c86c937c2a2226b6d6eb7f384f
User & Date: tangent 2015-08-14 04:17:16
Context
2015-08-14
05:29
Better fix for the old problem of how to distinguish a 1-parameter template query call to Query::store() and friends from a raw query string call, which allows it to do the right thing on OS X with Clang. Not sure why this doesn't affect MySQL++, but it doesn't. (Tested 3.2.2.) check-in: 5c2b34bee3 user: tangent tags: trunk
04:17
Added <tr1/cstdint> alternative between <cstdint> and <boost/cstdint.hpp> check-in: 169bdfd29a user: tangent tags: trunk
03:55
Dropped the versioned crnl-glob Fossil setting. All *.md and *.txt are now LF-only. check-in: c37cba89a5 user: tangent tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to CMakeLists.txt.

85
86
87
88
89
90
91




92
93
94
95
96
97
98
99
100

101
102
103
104
105
106
107
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/modules)

# Try to find some kind of "stdint" type header.
find_path(LIBTABULA_HAVE_CSTDINT cstdint)
if (LIBTABULA_HAVE_CSTDINT)
	message("found C++11's <cstdint> header")
else()




	find_path(LIBTABULA_HAVE_BOOST_CSTDINT boost/cstdint.hpp)
	if (LIBTABULA_HAVE_BOOST_CSTDINT)
		message("found <boost/cstdint.hpp>")
	else()
		find_path(LIBTABULA_HAVE_STDINT_H stdint.h)
		if (LIBTABULA_HAVE_STDINT_H)
			message("found C99's <stdint.h>; hope we can use it in C++")
		else()
			message(SEND_ERROR "WARNING: no 'stdint' type header found!")

		endif()
	endif()
endif()

set(MYSQL_FIND_REQUIRED 1)
find_package(MySQL)








>
>
>
>
|
|
|
|
|
|
|
|
|
>







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/modules)

# Try to find some kind of "stdint" type header.
find_path(LIBTABULA_HAVE_CSTDINT cstdint)
if (LIBTABULA_HAVE_CSTDINT)
	message("found C++11's <cstdint> header")
else()
	find_path(LIBTABULA_HAVE_TR1_CSTDINT tr1/cstdint)
	if (LIBTABULA_HAVE_TR1_CSTDINT)
		message("found <tr1/cstdint>")
	else()
		find_path(LIBTABULA_HAVE_BOOST_CSTDINT boost/cstdint.hpp)
		if (LIBTABULA_HAVE_BOOST_CSTDINT)
			message("found <boost/cstdint.hpp>")
		else()
			find_path(LIBTABULA_HAVE_STDINT_H stdint.h)
			if (LIBTABULA_HAVE_STDINT_H)
				message("found C99's <stdint.h>; hope we can use it in C++")
			else()
				message(SEND_ERROR "WARNING: no 'stdint' type header found!")
			endif()
		endif()
	endif()
endif()

set(MYSQL_FIND_REQUIRED 1)
find_package(MySQL)

Changes to src/sql_types.h.

34
35
36
37
38
39
40


41
42
43
44
45
46
47
..
61
62
63
64
65
66
67












68
69
70
71
72
73
74
#include "common.h"
#include "tiny_int.h"

#include <string>

#if defined(LIBTABULA_HAVE_CSTDINT)
#	include <cstdint>


#elif defined(LIBTABULA_HAVE_BOOST_CSTDINT)
#	include <boost/cstdint.hpp>
#elif defined(LIBTABULA_HAVE_STDINT_H)
#	include <stdint.h>
#endif

namespace libtabula {
................................................................................
	typedef std::uint16_t			sql_smallint_unsigned;
	typedef std::int32_t			sql_int;
	typedef std::uint32_t			sql_int_unsigned;
	typedef std::int32_t			sql_mediumint;
	typedef std::uint32_t			sql_mediumint_unsigned;
	typedef std::int64_t			sql_bigint;
	typedef std::uint64_t			sql_bigint_unsigned;












#elif defined(LIBTABULA_HAVE_BOOST_CSTDINT)
	// Next best case: found the Boost emulation for this C++11 feature
	typedef tiny_int<boost::int8_t>	sql_tinyint;
	typedef tiny_int<boost::uint8_t>sql_tinyint_unsigned;
	typedef boost::int16_t			sql_smallint;
	typedef boost::uint16_t			sql_smallint_unsigned;
	typedef boost::int32_t			sql_int;







>
>







 







>
>
>
>
>
>
>
>
>
>
>
>







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include "common.h"
#include "tiny_int.h"

#include <string>

#if defined(LIBTABULA_HAVE_CSTDINT)
#	include <cstdint>
#elif defined(LIBTABULA_HAVE_TR1_CSTDINT)
#	include <tr1/cstdint>
#elif defined(LIBTABULA_HAVE_BOOST_CSTDINT)
#	include <boost/cstdint.hpp>
#elif defined(LIBTABULA_HAVE_STDINT_H)
#	include <stdint.h>
#endif

namespace libtabula {
................................................................................
	typedef std::uint16_t			sql_smallint_unsigned;
	typedef std::int32_t			sql_int;
	typedef std::uint32_t			sql_int_unsigned;
	typedef std::int32_t			sql_mediumint;
	typedef std::uint32_t			sql_mediumint_unsigned;
	typedef std::int64_t			sql_bigint;
	typedef std::uint64_t			sql_bigint_unsigned;
#elif defined(LIBTABULA_HAVE_TR1_CSTDINT)
	// Next best case: found the TR1 precursor for this C++11 feature
	typedef tiny_int<std::tr1::int8_t>sql_tinyint;
	typedef tiny_int<std::tr1::uint8_t>sql_tinyint_unsigned;
	typedef std::tr1::int16_t		sql_smallint;
	typedef std::tr1::uint16_t		sql_smallint_unsigned;
	typedef std::tr1::int32_t		sql_int;
	typedef std::tr1::uint32_t		sql_int_unsigned;
	typedef std::tr1::int32_t		sql_mediumint;
	typedef std::tr1::uint32_t		sql_mediumint_unsigned;
	typedef std::tr1::int64_t		sql_bigint;
	typedef std::tr1::uint64_t		sql_bigint_unsigned;
#elif defined(LIBTABULA_HAVE_BOOST_CSTDINT)
	// Next best case: found the Boost emulation for this C++11 feature
	typedef tiny_int<boost::int8_t>	sql_tinyint;
	typedef tiny_int<boost::uint8_t>sql_tinyint_unsigned;
	typedef boost::int16_t			sql_smallint;
	typedef boost::uint16_t			sql_smallint_unsigned;
	typedef boost::int32_t			sql_int;