From b787a3513be1b5f4deb949bc1fd4715341923b41 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 21 Jan 2014 18:04:09 +0000 Subject: [PATCH] [DBGHELP] * Move some inclusions to the main header. * Remove inclusions and definitions that already exist in the main header. * Improve header inclusions. CORE-7716 svn path=/trunk/; revision=61749 --- reactos/dll/win32/dbghelp/coff.c | 19 ---------- reactos/dll/win32/dbghelp/compat.c | 2 - reactos/dll/win32/dbghelp/cpu_arm.c | 6 --- reactos/dll/win32/dbghelp/cpu_arm64.c | 6 --- reactos/dll/win32/dbghelp/cpu_i386.c | 10 +---- reactos/dll/win32/dbghelp/cpu_ppc.c | 6 --- reactos/dll/win32/dbghelp/cpu_x86_64.c | 8 ---- reactos/dll/win32/dbghelp/crc32.c | 5 --- reactos/dll/win32/dbghelp/dbghelp.c | 10 +---- reactos/dll/win32/dbghelp/dbghelp_private.h | 41 +++++++++++++++++---- reactos/dll/win32/dbghelp/dwarf.c | 36 +----------------- reactos/dll/win32/dbghelp/dwarf.h | 2 + reactos/dll/win32/dbghelp/elf_module.c | 21 +---------- reactos/dll/win32/dbghelp/image.c | 7 ---- reactos/dll/win32/dbghelp/image_private.h | 2 + reactos/dll/win32/dbghelp/macho_module.c | 12 ------ reactos/dll/win32/dbghelp/minidump.c | 12 +----- reactos/dll/win32/dbghelp/module.c | 12 ------ reactos/dll/win32/dbghelp/msc.c | 24 +----------- reactos/dll/win32/dbghelp/path.c | 8 ---- reactos/dll/win32/dbghelp/pe_module.c | 13 ------- reactos/dll/win32/dbghelp/rosstubs.c | 3 +- reactos/dll/win32/dbghelp/source.c | 9 ----- reactos/dll/win32/dbghelp/stabs.c | 31 +--------------- reactos/dll/win32/dbghelp/stack.c | 7 ---- reactos/dll/win32/dbghelp/storage.c | 10 +---- reactos/dll/win32/dbghelp/symbol.c | 17 --------- reactos/dll/win32/dbghelp/type.c | 14 ------- reactos/dll/win32/dbghelp/wdbgexts.h | 2 + 29 files changed, 52 insertions(+), 303 deletions(-) diff --git a/reactos/dll/win32/dbghelp/coff.c b/reactos/dll/win32/dbghelp/coff.c index ea8a15fc1ba..6ab0b67d753 100644 --- a/reactos/dll/win32/dbghelp/coff.c +++ b/reactos/dll/win32/dbghelp/coff.c @@ -32,26 +32,7 @@ * Add symbol size to internal symbol table. */ -#include -//#include "wine/port.h" - -#include -//#include - -#include -#ifdef HAVE_UNISTD_H -# include -#endif - -//#include -//#include "windef.h" -//#include "winbase.h" -//#include "winternl.h" - -//#include "wine/exception.h" -#include #include "dbghelp_private.h" -#include WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_coff); diff --git a/reactos/dll/win32/dbghelp/compat.c b/reactos/dll/win32/dbghelp/compat.c index c940075ebd8..c9a49ca7fb5 100644 --- a/reactos/dll/win32/dbghelp/compat.c +++ b/reactos/dll/win32/dbghelp/compat.c @@ -1,5 +1,3 @@ -#include -#include #include "dbghelp_private.h" void* __HeapAlloc(int heap, int flags, size_t size) diff --git a/reactos/dll/win32/dbghelp/cpu_arm.c b/reactos/dll/win32/dbghelp/cpu_arm.c index 4deb909b978..1b561c68bca 100644 --- a/reactos/dll/win32/dbghelp/cpu_arm.c +++ b/reactos/dll/win32/dbghelp/cpu_arm.c @@ -19,13 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -//#include - -//#include "ntstatus.h" -#define WIN32_NO_STATUS #include "dbghelp_private.h" -//#include "winternl.h" -#include WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/cpu_arm64.c b/reactos/dll/win32/dbghelp/cpu_arm64.c index 235049dacde..87864afc06b 100644 --- a/reactos/dll/win32/dbghelp/cpu_arm64.c +++ b/reactos/dll/win32/dbghelp/cpu_arm64.c @@ -19,13 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#include "ntstatus.h" -#define WIN32_NO_STATUS #include "dbghelp_private.h" -#include "winternl.h" -#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/cpu_i386.c b/reactos/dll/win32/dbghelp/cpu_i386.c index f37f36f65c4..88642e0dbde 100644 --- a/reactos/dll/win32/dbghelp/cpu_i386.c +++ b/reactos/dll/win32/dbghelp/cpu_i386.c @@ -18,18 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#ifndef DBGHELP_STATIC_LIB -#include "ntstatus.h" -#endif - #include "dbghelp_private.h" #ifndef DBGHELP_STATIC_LIB -#include "wine/winbase16.h" -#include "winternl.h" -#include "wine/debug.h" +#include #endif WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/cpu_ppc.c b/reactos/dll/win32/dbghelp/cpu_ppc.c index 56571c51047..7543ef689ab 100644 --- a/reactos/dll/win32/dbghelp/cpu_ppc.c +++ b/reactos/dll/win32/dbghelp/cpu_ppc.c @@ -18,13 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#include "ntstatus.h" -#define WIN32_NO_STATUS #include "dbghelp_private.h" -#include "winternl.h" -#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/cpu_x86_64.c b/reactos/dll/win32/dbghelp/cpu_x86_64.c index 2e73aa305cf..d3e27205c02 100644 --- a/reactos/dll/win32/dbghelp/cpu_x86_64.c +++ b/reactos/dll/win32/dbghelp/cpu_x86_64.c @@ -19,15 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "ntstatus.h" -#define WIN32_NO_STATUS #include "dbghelp_private.h" -#include "winternl.h" -#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/crc32.c b/reactos/dll/win32/dbghelp/crc32.c index e1f604e6eec..61eaddef261 100644 --- a/reactos/dll/win32/dbghelp/crc32.c +++ b/reactos/dll/win32/dbghelp/crc32.c @@ -19,11 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include - #include "dbghelp_private.h" /* Copyright (C) 1986 Gary S. Brown diff --git a/reactos/dll/win32/dbghelp/dbghelp.c b/reactos/dll/win32/dbghelp/dbghelp.c index 0e63c142f70..ae4ea13b7ba 100644 --- a/reactos/dll/win32/dbghelp/dbghelp.c +++ b/reactos/dll/win32/dbghelp/dbghelp.c @@ -18,17 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include "dbghelp_private.h" -#include "wdbgexts.h" -#ifndef DBGHELP_STATIC_LIB -#include "winerror.h" -#include "psapi.h" -#include "wine/debug.h" -#include "winnls.h" -#endif +#include "wdbgexts.h" WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/dbghelp_private.h b/reactos/dll/win32/dbghelp/dbghelp_private.h index 2180fddedf8..de9fc6336d3 100644 --- a/reactos/dll/win32/dbghelp/dbghelp_private.h +++ b/reactos/dll/win32/dbghelp/dbghelp_private.h @@ -21,31 +21,56 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS +#include + +#include +#include + +#ifdef HAVE_SYS_MMAN_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif + #define _INC_WINDOWS #define COM_NO_WINDOWS_H -#include +#define NONAMELESSUNION +#define NONAMELESSSTRUCT #ifndef DBGHELP_STATIC_LIB + +#include + +#include +#define WIN32_NO_STATUS #include #include #include +#include #include #include #include +#include + +#include +#include #include -#else + +#else /* DBGHELP_STATIC_LIB */ + #include #include "compat.h" -#endif -//#include "oaidl.h" -//#include "winnls.h" +#endif /* DBGHELP_STATIC_LIB */ + #include #include - /* #define USE_STATS */ struct pool /* poor's man */ @@ -815,3 +840,5 @@ extern struct symt_pointer* extern struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, const char* name) DECLSPEC_HIDDEN; + +#include "image_private.h" diff --git a/reactos/dll/win32/dbghelp/dwarf.c b/reactos/dll/win32/dbghelp/dwarf.c index f25b0faec13..cca040ea77a 100644 --- a/reactos/dll/win32/dbghelp/dwarf.c +++ b/reactos/dll/win32/dbghelp/dwarf.c @@ -20,46 +20,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION - -#include - -//#include -//#include -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_SYS_MMAN_H -#include -#endif -//#include -//#include -//#include -#ifdef HAVE_UNISTD_H -# include -#endif -//#include -#include -#include +#include "dbghelp_private.h" #ifdef HAVE_ZLIB #include #endif -//#include "windef.h" -//#include "winbase.h" -//#include "winuser.h" -//#include "ole2.h" -//#include "oleauto.h" - -#ifndef DBGHELP_STATIC_LIB -#include -#include -#endif - -#include "dbghelp_private.h" -#include "image_private.h" - WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_dwarf); /* FIXME: diff --git a/reactos/dll/win32/dbghelp/dwarf.h b/reactos/dll/win32/dbghelp/dwarf.h index b96eab777ca..147f0a4bc05 100644 --- a/reactos/dll/win32/dbghelp/dwarf.h +++ b/reactos/dll/win32/dbghelp/dwarf.h @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma once + typedef enum dwarf_tag_e { DW_TAG_padding = 0x00, diff --git a/reactos/dll/win32/dbghelp/elf_module.c b/reactos/dll/win32/dbghelp/elf_module.c index f8015c1b6c2..469b3409d12 100644 --- a/reactos/dll/win32/dbghelp/elf_module.c +++ b/reactos/dll/win32/dbghelp/elf_module.c @@ -19,8 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" +#include "dbghelp_private.h" #if defined(__svr4__) || defined(__sun) #define __ELF__ 1 @@ -29,26 +28,10 @@ #define _FILE_OFFSET_BITS 32 #endif -#include -#include #include -#ifdef HAVE_SYS_STAT_H -# include -#endif #include -#ifdef HAVE_SYS_MMAN_H -#include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#include "dbghelp_private.h" - -#include "image_private.h" - -#include "wine/library.h" -#include "wine/debug.h" +#include #ifdef __ELF__ diff --git a/reactos/dll/win32/dbghelp/image.c b/reactos/dll/win32/dbghelp/image.c index 954a0ee21b3..3420caa9612 100644 --- a/reactos/dll/win32/dbghelp/image.c +++ b/reactos/dll/win32/dbghelp/image.c @@ -18,14 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -//#include -//#include -//#include - #include "dbghelp_private.h" -#include -#include WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/image_private.h b/reactos/dll/win32/dbghelp/image_private.h index 8b32795d48c..5af8358bdc6 100644 --- a/reactos/dll/win32/dbghelp/image_private.h +++ b/reactos/dll/win32/dbghelp/image_private.h @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma once + #ifdef HAVE_ELF_H # include #endif diff --git a/reactos/dll/win32/dbghelp/macho_module.c b/reactos/dll/win32/dbghelp/macho_module.c index 1aaa7f11afc..6013867cef5 100644 --- a/reactos/dll/win32/dbghelp/macho_module.c +++ b/reactos/dll/win32/dbghelp/macho_module.c @@ -21,22 +21,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include "dbghelp_private.h" #ifdef HAVE_MACH_O_LOADER_H -#include -#include -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_SYS_MMAN_H -# include -#endif - #include #include #include diff --git a/reactos/dll/win32/dbghelp/minidump.c b/reactos/dll/win32/dbghelp/minidump.c index b00f9e2fbd9..eda087cd390 100644 --- a/reactos/dll/win32/dbghelp/minidump.c +++ b/reactos/dll/win32/dbghelp/minidump.c @@ -18,17 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "ntstatus.h" -#define WIN32_NO_STATUS #include "dbghelp_private.h" -#include "winternl.h" -#include "psapi.h" -#include "wine/debug.h" + +#include WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/module.c b/reactos/dll/win32/dbghelp/module.c index b73c1da8b4b..1886dfaf7dc 100644 --- a/reactos/dll/win32/dbghelp/module.c +++ b/reactos/dll/win32/dbghelp/module.c @@ -19,20 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -//#include -//#include -//#include -#include - #include "dbghelp_private.h" -#ifndef DBGHELP_STATIC_LIB -#include -#include -#endif -//#include "winternl.h" - WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); const WCHAR S_ElfW[] = {'<','e','l','f','>','\0'}; diff --git a/reactos/dll/win32/dbghelp/msc.c b/reactos/dll/win32/dbghelp/msc.c index 4978acfc48f..73df7398e4d 100644 --- a/reactos/dll/win32/dbghelp/msc.c +++ b/reactos/dll/win32/dbghelp/msc.c @@ -32,29 +32,9 @@ * Add symbol size to internal symbol table. */ -#define NONAMELESSUNION - -#include "config.h" -#include "wine/port.h" - -#include -#include -#include - -#include -#ifdef HAVE_UNISTD_H -# include -#endif - -#include -#include "windef.h" -#include "winbase.h" -#include "winternl.h" - -#include "wine/exception.h" -#include "wine/debug.h" #include "dbghelp_private.h" -#include "wine/mscvpdb.h" + +#include WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_msc); diff --git a/reactos/dll/win32/dbghelp/path.c b/reactos/dll/win32/dbghelp/path.c index 0a3162d2860..f4eaa1bcab2 100644 --- a/reactos/dll/win32/dbghelp/path.c +++ b/reactos/dll/win32/dbghelp/path.c @@ -18,15 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -//#include -//#include -//#include - #include "dbghelp_private.h" -//#include "winnls.h" -#include -#include WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/pe_module.c b/reactos/dll/win32/dbghelp/pe_module.c index 43822216490..b10bec98604 100644 --- a/reactos/dll/win32/dbghelp/pe_module.c +++ b/reactos/dll/win32/dbghelp/pe_module.c @@ -21,20 +21,7 @@ * */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - #include "dbghelp_private.h" -#include "image_private.h" -#ifndef DBGHELP_STATIC_LIB -#include "winternl.h" -#include "wine/debug.h" -#endif WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/rosstubs.c b/reactos/dll/win32/dbghelp/rosstubs.c index 1dbc8a41308..f500a5ecb3a 100644 --- a/reactos/dll/win32/dbghelp/rosstubs.c +++ b/reactos/dll/win32/dbghelp/rosstubs.c @@ -20,8 +20,7 @@ #include "dbghelp_private.h" -ULONG __cdecl DbgPrint(IN PCCH Format, IN ...); -#define UNIMPLEMENTED DbgPrint("DBGHELP: %s is unimplemented, please try again later.\n", __FUNCTION__); +WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); #define PDBGHELP_CREATE_USER_DUMP_CALLBACK PVOID #define PSYM_ENUMPROCESSES_CALLBACK PVOID diff --git a/reactos/dll/win32/dbghelp/source.c b/reactos/dll/win32/dbghelp/source.c index d33908a3f5a..829a10da281 100644 --- a/reactos/dll/win32/dbghelp/source.c +++ b/reactos/dll/win32/dbghelp/source.c @@ -18,18 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#include -//#include -//#include -//#include -#include #include "dbghelp_private.h" -#ifndef DBGHELP_STATIC_LIB -#include -#endif - WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); static struct module* rb_module; diff --git a/reactos/dll/win32/dbghelp/stabs.c b/reactos/dll/win32/dbghelp/stabs.c index f37629eda33..065556c7b7c 100644 --- a/reactos/dll/win32/dbghelp/stabs.c +++ b/reactos/dll/win32/dbghelp/stabs.c @@ -29,41 +29,12 @@ * available (hopefully) from http://sources.redhat.com/gdb/onlinedocs */ -#include -//#include "wine/port.h" - -//#include -//#include -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_SYS_MMAN_H -#include -#endif -//#include -//#include -//#include -#ifdef HAVE_UNISTD_H -# include -#endif -//#include -#include -//#include +#include "dbghelp_private.h" #ifdef HAVE_MACH_O_NLIST_H # include #endif -//#include "windef.h" -//#include "winbase.h" -//#include "winnls.h" - -#include "dbghelp_private.h" - -#ifndef DBGHELP_STATIC_LIB -#include -#endif - WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_stabs); #ifndef DBGHELP_STATIC_LIB diff --git a/reactos/dll/win32/dbghelp/stack.c b/reactos/dll/win32/dbghelp/stack.c index 39df9feff1e..c8dcac1f448 100644 --- a/reactos/dll/win32/dbghelp/stack.c +++ b/reactos/dll/win32/dbghelp/stack.c @@ -21,14 +21,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -//#include -//#include -//#include -//#include - #include "dbghelp_private.h" -#include WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/storage.c b/reactos/dll/win32/dbghelp/storage.c index b91a0dd2853..5f9c62426e1 100644 --- a/reactos/dll/win32/dbghelp/storage.c +++ b/reactos/dll/win32/dbghelp/storage.c @@ -19,16 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ - -#include "config.h" -#include -#include - -#ifndef DBGHELP_STATIC_LIB -#include "wine/debug.h" -#endif - #include "dbghelp_private.h" + #ifdef USE_STATS #include #endif diff --git a/reactos/dll/win32/dbghelp/symbol.c b/reactos/dll/win32/dbghelp/symbol.c index aa462da9440..48ebb33bdb4 100644 --- a/reactos/dll/win32/dbghelp/symbol.c +++ b/reactos/dll/win32/dbghelp/symbol.c @@ -19,25 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "config.h" - -#include -#include -#include -#include -#include -#include - #include "dbghelp_private.h" -#ifndef DBGHELP_STATIC_LIB -#include "wine/debug.h" -#include "winnls.h" -#endif - WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); WINE_DECLARE_DEBUG_CHANNEL(dbghelp_symt); diff --git a/reactos/dll/win32/dbghelp/type.c b/reactos/dll/win32/dbghelp/type.c index 723c3ba37e6..ca57d1a3e28 100644 --- a/reactos/dll/win32/dbghelp/type.c +++ b/reactos/dll/win32/dbghelp/type.c @@ -22,20 +22,6 @@ * upon which full support for datatype handling will eventually be built. */ -#define NONAMELESSUNION - -#include "config.h" -#include -#include -#include - -#ifndef DBGHELP_STATIC_LIB -#include "windef.h" -#include "winbase.h" -#include "winnls.h" -#include "wine/debug.h" -#endif - #include "dbghelp_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); diff --git a/reactos/dll/win32/dbghelp/wdbgexts.h b/reactos/dll/win32/dbghelp/wdbgexts.h index 91bcbf55597..50fa09742e8 100644 --- a/reactos/dll/win32/dbghelp/wdbgexts.h +++ b/reactos/dll/win32/dbghelp/wdbgexts.h @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma once + typedef struct EXT_API_VERSION { USHORT MajorVersion;