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 5471a53..0b6db8c 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 e12ed68..fc50d1c 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 ab3e8f9..007fc5b 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 cafe713..a8c4c1c 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>