use C++ headers

This commit is contained in:
Sergiu Deitsch 2021-03-30 23:46:05 +02:00
parent 2f7d608a92
commit 01f3e543e3
25 changed files with 75 additions and 86 deletions

View File

@ -97,8 +97,6 @@ check_include_file_cxx (inttypes.h HAVE_INTTYPES_H)
check_include_file_cxx (memory.h HAVE_MEMORY_H)
check_include_file_cxx (pwd.h HAVE_PWD_H)
check_include_file_cxx (stdint.h HAVE_STDINT_H)
check_include_file_cxx (stdlib.h HAVE_STDLIB_H)
check_include_file_cxx (string.h HAVE_STRING_H)
check_include_file_cxx (strings.h HAVE_STRINGS_H)
check_include_file_cxx (sys/stat.h HAVE_SYS_STAT_H)
check_include_file_cxx (sys/syscall.h HAVE_SYS_SYSCALL_H)
@ -142,24 +140,24 @@ check_cxx_compiler_flag (-Wunnamed-type-template-args
# NOTE: Cannot use check_function_exists here since >=vc-14.0 can define
# snprintf as an inline function
check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF)
check_symbol_exists (snprintf cstdio HAVE_SNPRINTF)
check_library_exists (dbghelp UnDecorateSymbolName "" HAVE_DBGHELP)
check_cxx_source_compiles ("
#include <stdlib.h>
#include <cstdlib>
static void foo(void) __attribute__ ((unused));
int main(void) { return 0; }
" HAVE___ATTRIBUTE__)
check_cxx_source_compiles ("
#include <stdlib.h>
#include <cstdlib>
static void foo(void) __attribute__ ((visibility(\"default\")));
int main(void) { return 0; }
" HAVE___ATTRIBUTE__VISIBILITY_DEFAULT)
check_cxx_source_compiles ("
#include <stdlib.h>
#include <cstdlib>
static void foo(void) __attribute__ ((visibility(\"hidden\")));
int main(void) { return 0; }
" HAVE___ATTRIBUTE__VISIBILITY_HIDDEN)

View File

@ -1,10 +1,10 @@
// Copyright (c) 2008, Google Inc.
// All rights reserved.
//
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
@ -14,7 +14,7 @@
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -49,9 +49,9 @@
#define BASE_COMMANDLINEFLAGS_H__
#include "config.h"
#include <cstdlib> // for getenv
#include <cstring> // for memchr
#include <string>
#include <string.h> // for memchr
#include <stdlib.h> // for getenv
#ifdef HAVE_LIB_GFLAGS

View File

@ -149,8 +149,8 @@
// We need to include these header files after defining _XOPEN_SOURCE
// as they may define the _XOPEN_SOURCE macro.
#include <assert.h>
#include <stdlib.h> // for abort()
#include <cassert>
#include <cstdlib> // for abort()
#define MUTEX_NAMESPACE glog_internal_namespace_

View File

@ -79,15 +79,9 @@
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H
/* Define to 1 if you have the <syscall.h> header file. */
#cmakedefine HAVE_SYSCALL_H

View File

@ -34,7 +34,7 @@
//
// Note that we only have partial C++0x support yet.
#include <stdio.h> // for NULL
#include <cstdio> // for NULL
#include "utilities.h"
#include "demangle.h"

View File

@ -36,9 +36,9 @@
#ifndef _LOGGING_H_
#define _LOGGING_H_
#include <errno.h>
#include <string.h>
#include <time.h>
#include <cerrno>
#include <cstring>
#include <ctime>
#include <iosfwd>
#include <ostream>
#include <sstream>

View File

@ -36,7 +36,7 @@
#ifndef BASE_RAW_LOGGING_H_
#define BASE_RAW_LOGGING_H_
#include <time.h>
#include <ctime>
@ac_google_start_namespace@

View File

@ -41,7 +41,7 @@
// // that can't be accomplished e.g. via just VLOG(2) << ...;
// }
//
// The truth value that VLOG_IS_ON(level) returns is determined by
// The truth value that VLOG_IS_ON(level) returns is determined by
// the three verbosity level flags:
// --v=<n> Gives the default maximal active V-logging level;
// 0 is the default.

View File

@ -32,7 +32,7 @@
#include "utilities.h"
#include <algorithm>
#include <assert.h>
#include <cassert>
#include <iomanip>
#include <string>
#ifdef HAVE_UNISTD_H
@ -44,12 +44,12 @@
#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h> // For uname.
#endif
#include <time.h>
#include <ctime>
#include <fcntl.h>
#include <cstdio>
#include <iostream>
#include <stdarg.h>
#include <stdlib.h>
#include <cstdarg>
#include <cstdlib>
#ifdef HAVE_PWD_H
# include <pwd.h>
#endif
@ -57,7 +57,7 @@
# include <syslog.h>
#endif
#include <vector>
#include <errno.h> // for errno
#include <cerrno> // for errno
#include <sstream>
#ifdef OS_WINDOWS
#include "windows/dirent.h"

View File

@ -31,7 +31,7 @@
// The common part of the striplog tests.
#include <stdio.h>
#include <cstdio>
#include <string>
#include <iosfwd>
#include "glog/logging.h"

View File

@ -44,18 +44,17 @@
# include <sys/wait.h>
#endif
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <memory>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include "base/commandlineflags.h"
#include "glog/logging.h"
#include "glog/raw_logging.h"

View File

@ -34,13 +34,13 @@
#include "utilities.h"
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>
#include <cstdio>
#include <cerrno>
#ifdef HAVE_UNISTD_H
# include <unistd.h> // for close() and write()
#endif
#include <fcntl.h> // for open()
#include <time.h>
#include <ctime>
#include "config.h"
#include "glog/logging.h" // To pick up flag settings etc.
#include "glog/raw_logging.h"

View File

@ -36,8 +36,8 @@
#include "symbolize.h"
#include "glog/logging.h"
#include <signal.h>
#include <time.h>
#include <csignal>
#include <ctime>
#ifdef HAVE_UCONTEXT_H
# include <ucontext.h>
#endif

View File

@ -37,9 +37,9 @@
#if defined(HAVE_PTHREAD)
# include <pthread.h>
#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <string>
#include "glog/logging.h"

View File

@ -35,7 +35,7 @@
// http://www.linux-foundation.org/spec/ELF/ppc64/PPC-elf64abi-1.9.html#STACK
// Linux has similar code: http://patchwork.ozlabs.org/linuxppc/patch?id=8882
#include <stdio.h>
#include <cstdio>
#include <stdint.h> // for uintptr_t
#include "stacktrace.h"

View File

@ -29,8 +29,8 @@
#include "utilities.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include "config.h"
#include "base/commandlineflags.h"
#include "glog/logging.h"

View File

@ -38,7 +38,7 @@
#include <sys/mman.h>
#endif
#include <stdio.h> // for NULL
#include <cstdio> // for NULL
#include "stacktrace.h"
_START_GOOGLE_NAMESPACE_

View File

@ -31,10 +31,9 @@
//
// Produce stack trace using libgcc
extern "C" {
#include <stdlib.h> // for NULL
#include <cstdlib> // for NULL
#include <unwind.h> // ABI defined unwinder
}
#include "stacktrace.h"
_START_GOOGLE_NAMESPACE_

View File

@ -56,7 +56,7 @@
#if defined(HAVE_SYMBOLIZE)
#include <string.h>
#include <cstring>
#include <algorithm>
#include <limits>
@ -118,14 +118,14 @@ _END_GOOGLE_NAMESPACE_
#else
#include <elf.h>
#endif
#include <errno.h>
#include <cerrno>
#include <climits>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@ -849,7 +849,7 @@ _END_GOOGLE_NAMESPACE_
#elif defined(OS_MACOSX) && defined(HAVE_DLADDR)
#include <dlfcn.h>
#include <string.h>
#include <cstring>
_START_GOOGLE_NAMESPACE_
@ -951,7 +951,7 @@ _END_GOOGLE_NAMESPACE_
#else /* HAVE_SYMBOLIZE */
#include <assert.h>
#include <cassert>
#include "config.h"

View File

@ -33,7 +33,7 @@
#include "utilities.h"
#include <signal.h>
#include <csignal>
#include <iostream>
#include "glog/logging.h"

View File

@ -31,14 +31,14 @@
#include "utilities.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include <signal.h>
#include <csignal>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <time.h>
#include <ctime>
#if defined(HAVE_SYSCALL_H)
#include <syscall.h> // for syscall()
#elif defined(HAVE_SYS_SYSCALL_H)

View File

@ -34,9 +34,9 @@
#include "utilities.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <cstring>
#include <cstdlib>
#include <cerrno>
#include <cstdio>
#include <string>
#include "base/commandlineflags.h"

View File

@ -27,15 +27,14 @@
#endif
#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
#include <wchar.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#include <sys/types.h>
#include <cerrno>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cwchar>
#include <sys/stat.h>
#include <errno.h>
#include <sys/types.h>
/* Indicates that d_type field is available in dirent structure */
#define _DIRENT_HAVE_D_TYPE

View File

@ -1,10 +1,10 @@
/* Copyright (c) 2008, Google Inc.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -37,7 +37,7 @@
#endif
#include "config.h"
#include <stdarg.h> // for va_list, va_start, va_end
#include <cstdarg> // for va_list, va_start, va_end
#include "port.h"
// These call the windows _vsnprintf, but always NUL-terminate.

View File

@ -1,10 +1,10 @@
/* Copyright (c) 2008, Google Inc.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -54,10 +54,10 @@
#include <io.h> /* because we so often use open/close/etc */
#include <direct.h> /* for _getcwd() */
#include <process.h> /* for _getpid() */
#include <stdio.h> /* read in vsnprintf decl. before redifining it */
#include <stdarg.h> /* template_dictionary.cc uses va_copy */
#include <string.h> /* for _strnicmp(), strerror_s() */
#include <time.h> /* for localtime_s() */
#include <cstdarg> /* template_dictionary.cc uses va_copy */
#include <cstdio> /* read in vsnprintf decl. before redifining it */
#include <cstring> /* for _strnicmp(), strerror_s() */
#include <ctime> /* for localtime_s() */
/* Note: the C++ #includes are all together at the bottom. This file is
* used by both C and C++ code, so we put all the C++ together.
*/