Skip to content

Commit

Permalink
Require C++17 or better.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtv committed May 7, 2019
1 parent bc90183 commit 0b5c7d2
Show file tree
Hide file tree
Showing 27 changed files with 1,293 additions and 634 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ string(STRIP ${VER_FILE_CONTENT} VER_FILE_CONTENT)
project(libpqxx VERSION ${VER_FILE_CONTENT} LANGUAGES CXX)

if(NOT "${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_CXX11 = @HAVE_CXX11@
HAVE_CXX17 = @HAVE_CXX17@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
Expand Down
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
7.0.0
- Bumped minimum required C++ version to C++17.
- Removed tablereader/tablewriter, replaced by stream_from/stream_to.
- Removed obsolete transactor framework, replaced by post-C++11 one.
- Removed old ways of invoking parameterised and prepared statements.
- Session variables are no longer cached.
- If you do weird stuff with setting/getting variables, it may now break.
- If you do weird stuff with setting/getting variables, it may break.
- Reading a variable written from raw SQL, procedures, etc, will now work.
- Prepared statements are now registered immediately.
- If you do weird stuff with preparing/unpreparing statements, it may break.
Expand Down
10 changes: 2 additions & 8 deletions README-UPGRADE
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
NOTICES FOR USERS UPGRADING FROM EARLIER VERSIONS TO 6.x
NOTICES FOR USERS UPGRADING FROM EARLIER VERSIONS TO 7.x

As of 6.0, libpqxx requires C++11 or better. Make sure that your libpqxx is
As of 7.0, libpqxx requires C++17 or better. Make sure that your libpqxx is
built against the same version of the C++ standard as your own application, or
there may be build problems.

It may be possible to paper over some mismatches. If your application build
fails with errors about `std::experimental::optional`, try defining a macro
`PQXX_HIDE_EXP_OPTIONAL` in your application's build. This will suppress
support for `std::experimental::optional` even if libpqxx was built to assume
that the feature is present.
77 changes: 7 additions & 70 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1161,103 +1161,40 @@ namespace cxx17
]])

# =============================================================================
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html
# =============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional])
# AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++11
# Check for baseline language coverage in the compiler for the C++17
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++11. The two optional arguments are
# macro with the version set to C++17. The two optional arguments are
# forwarded literally as the second and third argument respectively.
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
# more information. If you want to use this macro, you also need to
# download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <[email protected]>
# Copyright (c) 2012 Zack Weinberg <[email protected]>
# Copyright (c) 2013 Roy Stogner <[email protected]>
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <[email protected]>
# Copyright (c) 2015 Paul Norman <[email protected]>
# Copyright (c) 2015 Moritz Klammler <[email protected]>
# Copyright (c) 2016 Krzesimir Nowak <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 18
#serial 2

AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])

# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_gcc_const_call.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_GCC_CONST_CALL
#
# DESCRIPTION
#
# The macro will compile a test program to see whether the compiler does
# understand the per-function postfix pragma.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <[email protected]>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 8

AC_DEFUN([AX_GCC_CONST_CALL],[dnl
AC_CACHE_CHECK(
[whether the compiler supports function __attribute__((__const__))],
ax_cv_gcc_const_call,[
AC_TRY_COMPILE([__attribute__((__const__))
int f(int i) { return i; }],
[],
ax_cv_gcc_const_call=yes, ax_cv_gcc_const_call=no)])
if test "$ax_cv_gcc_const_call" = yes; then
AC_DEFINE([GCC_CONST_CALL],[__attribute__((__const__))],
[most gcc compilers know a function __attribute__((__const__))])
fi
])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])])

# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_have_poll.html
Expand Down
2 changes: 1 addition & 1 deletion config/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_CXX11 = @HAVE_CXX11@
HAVE_CXX17 = @HAVE_CXX17@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
Expand Down
2 changes: 0 additions & 2 deletions configitems
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ PACKAGE_VERSION internal autotools
PQXX_HAVE_CHARCONV_INT internal compiler
PQXX_HAVE_CHARCONV_FLOAT internal compiler
PQXX_HAVE_GCC_CONST public compiler
PQXX_HAVE_GCC_DEPRECATED public compiler
PQXX_HAVE_GCC_PURE public compiler
PQXX_HAVE_DEPRECATED public compiler
PQXX_HAVE_GCC_VISIBILITY internal compiler
PQXX_HAVE_OPTIONAL public compiler
PQXX_HAVE_EXP_OPTIONAL public compiler
Expand Down
Loading

0 comments on commit 0b5c7d2

Please sign in to comment.