]> www.ginac.de Git - ginac.git/commitdiff
Prefer C library wrappers over C headers, where possible.
authorRichard Kreckel <kreckel@ginac.de>
Wed, 13 Apr 2016 06:10:22 +0000 (08:10 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Wed, 13 Apr 2016 06:10:22 +0000 (08:10 +0200)
acinclude.m4
cmake/modules/FindGiNaC.cmake
cmake/modules/FindReadline.cmake
ginsh/ginsh.h

index 5471a53c455ac37d0d7377a40470553aef1bc63d..0b6db8c178d85ccfc4a85e93d2aec71069ad9245 100644 (file)
@@ -30,6 +30,9 @@ AC_CACHE_CHECK([for standard C++ header files], [ginac_cv_std_cxx_headers], [
        AC_LANG_PUSH([C++])
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                #include <algorithm>
+               #include <cstddef>
+               #include <cstdio>
+               #include <cstdlib>
                #include <cstring>
                #include <cstddef>
                #include <cstdint>
@@ -81,7 +84,7 @@ else
        AC_CACHE_CHECK([for version of libreadline], [ginac_cv_rl_supported], [
                ginac_cv_rl_supported="no"
                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-                       #include <stdio.h>
+                       #include <cstdio>
                        #include <readline/readline.h>
                        #if !defined(RL_VERSION_MAJOR) || !defined(RL_VERSION_MINOR)
                        #error "Ancient/unsupported version of readline"
index e12ed6864ef9e562189e836c08ff930a0580f161..fc50d1c36c4d05e621b380b19e8b6e8bb129bab2 100644 (file)
@@ -116,7 +116,7 @@ if (GINAC_INCLUDE_DIRS AND GINAC_LIBRARIES AND NOT CMAKE_CROSSCOMPILING)
        check_cxx_source_runs("
                #include <ginac/version.h>
                #include <cln/version.h>
-               #include <stdio.h>
+               #include <cstdio>
                int main() {
                        return (CL_VERSION_MAJOR == cln::version_major) &&
                               (CL_VERSION_MINOR == cln::version_minor) &&
index ab3e8f917a9b1e917346056619faf6c957494d32..007fc5b80f5f771774bd3a33e1a212af228f4196 100644 (file)
@@ -21,7 +21,7 @@ if (READLINE_INCLUDE_DIRS AND READLINE_LIBRARIES)
        set(_save_req_includes ${CMAKE_REQUIRED_INCLUDES})
        set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${READLINE_INCLUDE_DIR})
        check_cxx_source_compiles("
-               #include <stdio.h>
+               #include <cstdio>
                #include <readline/readline.h>
                #if !defined(RL_VERSION_MAJOR) || !defined(RL_VERSION_MINOR)
                #error Ancient version of readline
index cafe713afacffb9c4a2fa33ce3934ccaad0dfc05..a8c4c1c6994bf292edc81db50af09e6ad0805796 100644 (file)
 #ifndef GINSH_H
 #define GINSH_H
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 #include <map>
 #include <iostream>
 #include <string>