Sergiu Deitsch
93549f3600
chore: apply clang-format
2023-12-30 20:38:56 +01:00
Sergiu Deitsch
e3f5398aa1
rework public header structure ( #1012 )
...
Promote generated headers to regular headers. This enables direct
editing of corresponding files and running automatic source code
formatting and static analysis tools, such as clang-format and
clang-tidy on the whole project which previously was not
straightforward.
2023-12-30 19:05:26 +01:00
Sergiu Deitsch
3fcf77a691
fix: drop custom (v)snprintf definition ( #992 )
...
The functions are available since C++11.
2023-12-20 20:49:08 +01:00
Brad Smith
aca9a23c83
fixed OpenBSD support ( #921 )
...
- Usage of syscall() is not allowed
- Use getthrid() to retreive the thread ID
2023-05-10 13:41:38 +02:00
Sergiu Deitsch
6742834201
move to C++14 ( #902 )
2023-02-28 12:26:49 +01:00
Sergiu Deitsch
f4dd77ae6b
ci: reworked windows builds
2021-12-06 19:00:41 +01:00
Sergiu Deitsch
4a55b11580
ci: added linux github workflow
2021-10-11 15:54:42 +02:00
huangqinjin
3965584721
support stack unwind on Android
2021-10-08 22:14:20 +02:00
Sergiu Deitsch
8474b7854b
added gmock support
2021-10-07 19:53:08 +02:00
Sergiu Deitsch
f7407d4d27
export OS_* defines ( fixes #715 )
2021-10-01 11:26:07 +02:00
Sergiu Deitsch
0b83bb203d
eliminate warnings
2021-07-22 22:52:22 +02:00
z-aki
4a4331f2f2
Fix syscall deprecation warning on macOS >= 10.12
...
Fix #185
2021-07-14 19:51:19 +05:30
Sergiu Deitsch
c39fcf6e8a
ci: added more targets
2021-07-14 02:21:58 +02:00
Tongliang Liao
81e0d616ed
Expose IsGoogleLoggingInitialized() in public API.
...
Usually library does not have control of the process lifespan.
Without this function, it is impossible to init/shutdown reliably.
It has been one of the major pain points for years when using glog in libraries.
AFAIK 3 workarounds have been used previously:
1. Init without checking. This causes compatiblity issues with other libs using glog.
2. Also provide a init function in library's API. This makes API complicated and stateful, especially for libs that does not mean to stay for the entire life of process.
3. Steal the utility function in internal namespace. Does not work with msvc (due to missing dllexport) or `gcc -fvisibility=hidden`.
None of them are perfect, except for the last hack that usually works well on Linux.
0.5.0 changes default visibility to hidden and it does not work anymore.
Resolve https://github.com/google/glog/issues/125
2021-05-14 08:57:32 +08:00
Sergiu Deitsch
01f3e543e3
use C++ headers
2021-03-31 02:24:22 +02:00
Fabrice Fontaine
9630e0e848
src/utilities: fix build without pthread
...
- Remove is_default_thread function which is an internal and not used
function
- Remove g_main_thread_id as it was used only by is_default_thread
Fixes:
- http://autobuild.buildroot.net/results/5320bbe1205e782e3516d9bead8d1ed825bcbaad
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-11-02 02:09:07 +01:00
Sergiu Deitsch
242130d305
Merge pull request #350 from TheModMaker/fixIosSim
...
Allow getpwuid_r to return missing entry.
2019-10-31 23:00:31 +01:00
Fumitoshi Ukai
ba8a9f6952
fix typo: TOOD -> TODO ( #448 )
2019-05-07 16:02:06 +09:00
Jacob Trimble
a606c3187b
Allow getpwuid_r to return missing entry.
...
If the getpwuid_r method doesn't find an entry with the given ID, it
will still return success (0), but the *result will be set to NULL.
This checks the |result| value so it won't crash if it doesn't find
the entry.
This normally shouldn't ever happen, but it can somehow happen on
iOS simulators.
2018-07-27 10:58:18 -07:00
Sergiu Deitsch
2f493d292c
Merge pull request #302 from Nazg-Gul/missing-prototype
...
Resolve missing prototype warning
2018-03-21 13:45:06 +01:00
Shinichiro Hamaji
56b81ea796
Style fixes for consistency
2017-10-20 16:11:31 +09:00
Dariusz Ostolski
2d3cf2681d
Fix username lookup in case of missing USER environment variable
2017-09-19 22:23:53 +02:00
Shinichiro Hamaji
a808e435b7
Merge pull request #157 from sergiud/cygwin-support
...
Cygwin support
2017-07-06 15:00:06 +09:00
Andrew Schwartzmeyer
d1f49ba5aa
Support signal handler on Windows
2017-06-27 10:50:20 -07:00
Shinichiro Hamaji
a6266db97a
Add a hack for naive include scanners
2017-05-09 17:35:18 +09:00
Sergiu Deitsch
96a09ae01a
fixed cygwin compilation errors
2017-01-17 12:47:11 +01:00
Sergey Sharybin
f94a49c571
Resolve missing prototype warning
...
Makes compilation process less noisy even when using string compiler flags.
2015-12-31 17:55:37 +05:00
Yoshisato Yanagisawa
cda16b3443
Reset SIGABRT action only if FailureSignalHandler is installed.
...
When I set my own signal handler to SIGABRT, it did not executed
with CHECK. That is because SIGABRT handler is reset to default
just before glog calls abort.
Let me make it reset only if the handler is what glog installed
i.e. FailureSignalHandler.
2015-11-26 16:19:22 +09:00
478a80caa0
Attempt to improve mingw-w64 support
...
- Set -Isrc/windows for mingw
- Check existence of sigaction, pread, and pwrite
- Provide alternative implementation of pread and pwrite
- Eliminate symlink code for OS_WINDOWS
- Don't check /proc/self/fd if the OS isn't linux
- Don't use MSVC specific declarations in port.h for mingw
git-svn-id: https://google-glog.googlecode.com/svn/trunk@135 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-02-18 10:56:53 +00:00
74ae299924
Allow users to re-initialize glog
...
http://code.google.com/p/google-glog/issues/detail?id=83
http://code.google.com/p/google-glog/issues/detail?id=125
http://code.google.com/p/google-glog/issues/detail?id=142
git-svn-id: https://google-glog.googlecode.com/svn/trunk@121 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-01-10 07:46:20 +00:00
96dac4fd02
Fixed files to support FreeBSD amd64 based on patches at:
...
http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/glog/files/
Since FreeBSD do not have gettid system call unlikely to MacOSX, I
modified utilities.h not to use that on FreeBSD:
* FreeBSD lacks gettid syscall.
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/syscalls.master?rev=1.276;content-type=text%2Fplain
* MacOSX gettid == 286.
http://www.opensource.apple.com/source/xnu/xnu-1504.3.12/bsd/kern/syscalls.master
As for the fix of stacktrace, we use a different approach.
Even in FreeBSD, package gcc44/gcc46 has unwind.h.
As a result, checking unwind.h should be natural solution.
This patch was given by yyanagisawa
git-svn-id: https://google-glog.googlecode.com/svn/trunk@116 eb4d4688-79bd-11dd-afb4-1d65580434c0
2012-11-22 12:09:13 +00:00
73b0abc989
Remove trivial warnings produced by clang
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@107 eb4d4688-79bd-11dd-afb4-1d65580434c0
2012-01-12 08:41:09 +00:00
ac3e918969
Suppress warnings around return value of write and symlink.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@97 eb4d4688-79bd-11dd-afb4-1d65580434c0
2011-09-05 08:00:43 +00:00
c2cbc763ed
Destruct global objects in ShutdownGoogleLogging
...
http://code.google.com/p/google-glog/issues/detail?id=69
git-svn-id: https://google-glog.googlecode.com/svn/trunk@96 eb4d4688-79bd-11dd-afb4-1d65580434c0
2011-09-05 08:00:01 +00:00
54421697f4
Create a new log files after pid has changed
...
http://code.google.com/p/google-glog/issues/detail?id=51
http://code.google.com/p/google-glog/issues/detail?id=74
http://code.google.com/p/google-glog/issues/detail?id=82
git-svn-id: https://google-glog.googlecode.com/svn/trunk@94 eb4d4688-79bd-11dd-afb4-1d65580434c0
2011-09-05 07:56:21 +00:00
1e86eecaf6
Minor message update.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@90 eb4d4688-79bd-11dd-afb4-1d65580434c0
2010-06-15 07:04:56 +00:00
858a11d4e3
Add ShutdownGoogleLogging to close syslog.
...
This patch was contributed by DGunchev (thanks!)
http://code.google.com/p/google-glog/issues/detail?id=28
git-svn-id: https://google-glog.googlecode.com/svn/trunk@88 eb4d4688-79bd-11dd-afb4-1d65580434c0
2010-06-15 06:28:38 +00:00
cb35010215
Use GLOG_* environment variables even when gflags is installed.
...
Define GLOG_DEFINE_*, which checks if the GLOG_* environment variable
is defined. If defined, GLOG_DEFINE_* passes the value and otherwise,
it passes the original default value. In this way, GLOG_DEFINE_* macro
uses the value specified by gflags first, then GLOG_* environment
variables, and finally it uses the default value if neither of them are
specified.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@76 eb4d4688-79bd-11dd-afb4-1d65580434c0
2010-01-20 07:39:18 +00:00
1b5a90b691
Cast from pthread_t to pid_t via uintptr_t.
...
On 64bit NetBSD, pthread_t is a pointer and pid_t is an integer so
we cannot cast from pthread_t to pid_t directoly due to difference of
their size.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@69 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-30 10:45:13 +00:00
f028227fa3
Define DumpPCAndSymbol() only when HAVE_SYMBOLIZE is defined.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@65 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-29 09:11:48 +00:00
d712e2084a
Fix user name detection for Windows.
...
This patch was given by ademin (thanks!).
http://code.google.com/p/google-glog/issues/detail?id=12
git-svn-id: https://google-glog.googlecode.com/svn/trunk@64 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-29 08:38:20 +00:00
fc88a722eb
Suppress warnings.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@63 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-29 08:37:32 +00:00
a86eb1ac62
Check if InitGoogleLogging is not called twice.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@47 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-10 16:15:53 +00:00
ddfd1884b6
A bug fix for Windows: Use GetSystemTimeAsFileTime instead of GetSystemTime. SYSTEMTIME's mSecond is not a unix time but like tm.tm_sec.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@45 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-09 07:49:44 +00:00
b86afef3f7
Fixes for GCC 4.4. Thanks John for this patch!
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@41 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-03-10 02:15:40 +00:00
f365379532
Add license information for all source code.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@39 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-28 17:04:50 +00:00
630e77bac0
Remove unnecessary #include.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@31 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-23 18:48:11 +00:00
e31a91b650
* Add LOG_TO_STRING.
...
* Add LOG_AT_LEVEL.
* Add DVLOG.
* Add LOG_TO_SINK_ONLY.
* Log microseconds.
* Add --log_backtrace_at option.
* Introduce CrashReason class.
* Fix some bugs.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@29 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-15 10:34:35 +00:00
9de1077eed
Define ARRAYSIZE in utilities.h and use it.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@27 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-09 06:07:55 +00:00
afd586a5d5
Initial windows support. Now we don't have the stacktrace and several unittests.
...
git-svn-id: https://google-glog.googlecode.com/svn/trunk@23 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-12-19 15:20:40 +00:00