diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2021-11-23 09:02:17 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2021-11-23 09:22:00 +0300 |
commit | f6b65d9e617795846e33b3f8e4391a4f028bf48d (patch) | |
tree | 2d5f0c9de2d1aff17ae64bb4e517c31117e919db | |
parent | ccd7689eee5b53186013263ca7cfda34f217f57b (diff) | |
download | bdwgc-f6b65d9e617795846e33b3f8e4391a4f028bf48d.tar.gz |
Remove msvc_dbg.h file
(refactoring)
* NT_MAKEFILE (tests\test.obj): Remove msvc_dbg.h from dependencies.
* README.md (Copyright & Warranty): Do not mention msvc_dbg.h.
* extra/msvc_dbg.c [!_M_ARM && !_M_ARM64 && !_M_X64 && _MSC_VER]: Do
not include msvc_dbg.h; include stdlib.h.
* extra/msvc_dbg.c [!_M_ARM && !_M_ARM64 && !_M_X64 && _MSC_VER]
(backtrace, backtrace_symbols): Declare (as extern C).
* os_dep.c [GC_HAVE_BUILTIN_BACKTRACE && _MSC_VER] (backtrace,
backtrace_symbols): Likewise.
* extra/msvc_dbg.c [!_M_ARM && !_M_ARM64 && !_M_X64 && _MSC_VER]
(backtrace_symbols): Match argument types in the definition to those
in the declaration.
* include/include.am (EXTRA_DIST): Do not add msvc_dbg.h.
* include/private/msvc_dbg.h: Remove.
-rw-r--r-- | NT_MAKEFILE | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | extra/msvc_dbg.c | 19 | ||||
-rw-r--r-- | include/include.am | 3 | ||||
-rw-r--r-- | include/private/msvc_dbg.h | 42 | ||||
-rw-r--r-- | os_dep.c | 7 |
6 files changed, 23 insertions, 52 deletions
diff --git a/NT_MAKEFILE b/NT_MAKEFILE index be38b987..c46fe44d 100644 --- a/NT_MAKEFILE +++ b/NT_MAKEFILE @@ -118,7 +118,7 @@ check: check-deps .cpp.obj: $(cc) $(cdebug) $(cflags) $(CFLAGS_SPECIFIC) -Iinclude $(CFLAGS_DEFAULT) $(CXXFLAGS_SPECIFIC) -D_CRT_SECURE_NO_DEPRECATE $(CFLAGS_EXTRA) $*.cpp /Fo$*.obj -$(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h include\gc_disclaim.h include\private\msvc_dbg.h +$(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h include\gc_disclaim.h !IFDEF ENABLE_STATIC @@ -572,7 +572,7 @@ The files Makefile.am and configure.ac are * Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved. -The files extra/msvc_dbg.c and include/private/msvc_dbg.h are +The file extra/msvc_dbg.c is * Copyright (c) 2004-2005 Andrei Polushin diff --git a/extra/msvc_dbg.c b/extra/msvc_dbg.c index 819023f1..2f58c01a 100644 --- a/extra/msvc_dbg.c +++ b/extra/msvc_dbg.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2004 Andrei Polushin + Copyright (c) 2004-2005 Andrei Polushin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -26,8 +26,9 @@ /* TODO: arm[64], x86_64 currently miss some machine-dependent code below. */ /* See also GC_HAVE_BUILTIN_BACKTRACE in gc_config_macros.h. */ +#include <stdlib.h> + #define GC_BUILD -#include "private/msvc_dbg.h" #include "gc.h" #ifndef WIN32_LEAN_AND_MEAN @@ -40,6 +41,18 @@ #include <imagehlp.h> #pragma pack(pop) +#ifdef __cplusplus + extern "C" { +#endif + +/* Compatibility with <execinfo.h> */ +int backtrace(void* addresses[], int count); +char** backtrace_symbols(void* const addresses[], int count); + +#ifdef __cplusplus + } /* extern "C" */ +#endif + #pragma comment(lib, "dbghelp.lib") #pragma optimize("gy", off) @@ -358,7 +371,7 @@ int backtrace(void* addresses[], int count) return GetStackFrames(1, addresses, count); } -char** backtrace_symbols(void*const* addresses, int count) +char** backtrace_symbols(void* const addresses[], int count) { size_t size = GetDescriptionFromStack(addresses, count, NULL, NULL, 0); char** symbols = (char**)malloc(size); diff --git a/include/include.am b/include/include.am index cf27e0b3..bef626b0 100644 --- a/include/include.am +++ b/include/include.am @@ -62,9 +62,6 @@ dist_noinst_HEADERS += \ include/private/specific.h \ include/private/thread_local_alloc.h -# files used by makefiles other than *.am -EXTRA_DIST += include/private/msvc_dbg.h - # unprefixed header include_HEADERS += \ include/extra/gc.h diff --git a/include/private/msvc_dbg.h b/include/private/msvc_dbg.h deleted file mode 100644 index ff64a425..00000000 --- a/include/private/msvc_dbg.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (c) 2004-2005 Andrei Polushin - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#ifndef GC_MSVC_DBG_H -#define GC_MSVC_DBG_H - -#include <stdlib.h> - -#ifdef __cplusplus - extern "C" { -#endif - -#define MSVC_DBG_EXPORT /* empty */ - -/* Compatibility with <execinfo.h> */ -MSVC_DBG_EXPORT int backtrace(void* addresses[], int count); -MSVC_DBG_EXPORT char** backtrace_symbols(void* const addresses[], int count); - -#ifdef __cplusplus - } /* extern "C" */ -#endif - -#endif /* GC_MSVC_DBG_H */ @@ -5035,11 +5035,14 @@ GC_API int GC_CALL GC_get_pages_executable(void) #if defined(GC_HAVE_BUILTIN_BACKTRACE) # ifdef _MSC_VER -# include "private/msvc_dbg.h" + EXTERN_C_BEGIN + int backtrace(void* addresses[], int count); + char** backtrace_symbols(void* const addresses[], int count); + EXTERN_C_END # else # include <execinfo.h> # endif -#endif +#endif /* GC_HAVE_BUILTIN_BACKTRACE */ #ifdef SAVE_CALL_CHAIN |