https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7fa8c40ed522bacba6c3549a16a3e20b6a91075e

commit 7fa8c40ed522bacba6c3549a16a3e20b6a91075e
Author:     winesync <[email protected]>
AuthorDate: Fri Sep 11 18:49:27 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Sep 16 10:35:51 2020 +0200

    [WINESYNC] dbghelp: Use local declaration for 64-bit macho nlist.
    
    Signed-off-by: Jacek Caban <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id f48f8cc39980f2d93015ecd56f28e3e9f52843fe by Jacek Caban 
<[email protected]>
---
 dll/win32/dbghelp/image_private.h |  9 +++++++++
 dll/win32/dbghelp/macho_module.c  |  2 +-
 dll/win32/dbghelp/stabs.c         | 17 ++---------------
 sdk/tools/winesync/dbghelp.cfg    |  2 +-
 4 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/dll/win32/dbghelp/image_private.h 
b/dll/win32/dbghelp/image_private.h
index 7453976a403..955f7790a7a 100644
--- a/dll/win32/dbghelp/image_private.h
+++ b/dll/win32/dbghelp/image_private.h
@@ -145,6 +145,15 @@ struct stab_nlist
     unsigned            n_value;
 };
 
+struct macho64_nlist
+{
+    unsigned            n_strx;
+    unsigned char       n_type;
+    char                n_other;
+    short               n_desc;
+    UINT64              n_value;
+};
+
 BOOL image_check_alternate(struct image_file_map* fmap, const struct module* 
module) DECLSPEC_HIDDEN;
 
 BOOL elf_map_handle(HANDLE handle, struct image_file_map* fmap) 
DECLSPEC_HIDDEN;
diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c
index ff7cf2b3c03..ab88d271081 100644
--- a/dll/win32/dbghelp/macho_module.c
+++ b/dll/win32/dbghelp/macho_module.c
@@ -932,7 +932,7 @@ static int macho_parse_symtab(struct image_file_map* ifm,
     struct macho_debug_info*        mdi = user;
     const char*                     stabstr;
     int                             ret = 0;
-    size_t stabsize = (ifm->addr_size == 32) ? sizeof(struct stab_nlist) : 
sizeof(struct nlist_64);
+    size_t stabsize = (ifm->addr_size == 32) ? sizeof(struct stab_nlist) : 
sizeof(struct macho64_nlist);
     const char *stab;
 
     TRACE("(%p/%p, %p, %p) %u syms at 0x%08x, strings 0x%08x - 0x%08x\n", 
fmap, fmap->handle, lc,
diff --git a/dll/win32/dbghelp/stabs.c b/dll/win32/dbghelp/stabs.c
index 1d83d8de934..9190997cdf8 100644
--- a/dll/win32/dbghelp/stabs.c
+++ b/dll/win32/dbghelp/stabs.c
@@ -34,27 +34,14 @@
 
 #include <sys/types.h>
 #include <fcntl.h>
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
 #include <limits.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
 #include <stdio.h>
 #include <assert.h>
 #include <stdarg.h>
 
-#ifdef HAVE_MACH_O_NLIST_H
-# include <mach-o/nlist.h>
-#endif
-
 #ifndef DBGHELP_STATIC_LIB
 #include "windef.h"
 #include "winbase.h"
@@ -1298,7 +1285,7 @@ BOOL stabs_parse(struct module* module, ULONG_PTR 
load_offset,
 
 #ifdef __APPLE__
     if (module->process->is_64bit)
-        stabsize = sizeof(struct nlist_64);
+        stabsize = sizeof(struct macho64_nlist);
 #endif
     nstab = stablen / stabsize;
     strs_end = strs + strtablen;
@@ -1322,7 +1309,7 @@ BOOL stabs_parse(struct module* module, ULONG_PTR 
load_offset,
         n_value = stab_ptr->n_value;
 #ifdef __APPLE__
         if (module->process->is_64bit)
-            n_value = ((struct nlist_64 *)stab_ptr)->n_value;
+            n_value = ((struct macho64_nlist *)stab_ptr)->n_value;
 #endif
         ptr = strs + stab_ptr->n_strx;
         if ((ptr > strs_end) || (ptr + strlen(ptr) > strs_end))
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index c93a6fbe288..e3835e05f57 100644
--- a/sdk/tools/winesync/dbghelp.cfg
+++ b/sdk/tools/winesync/dbghelp.cfg
@@ -4,4 +4,4 @@ files:
   include/dbghelp.h: sdk/include/psdk/dbghelp.h
   include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
 tags:
-  wine: 061146c2ab530a54f8323331e88c5771dd7bba49
+  wine: f48f8cc39980f2d93015ecd56f28e3e9f52843fe

Reply via email to