Alexandre Julliard : include: Move DECLSPEC_HOTPATCH definition out of config.h.

Alexandre Julliard julliard at winehq.org
Thu May 2 16:45:08 CDT 2019


Module: wine
Branch: master
Commit: d624883047db221729331c95597ef383e4cb670a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d624883047db221729331c95597ef383e4cb670a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu May  2 16:47:55 2019 +0200

include: Move DECLSPEC_HOTPATCH definition out of config.h.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure           | 38 --------------------------------------
 configure.ac        | 15 ---------------
 include/config.h.in |  3 ---
 include/winnt.h     |  6 ++++++
 4 files changed, 6 insertions(+), 56 deletions(-)

diff --git a/configure b/configure
index 3cb8bc5..588364f 100755
--- a/configure
+++ b/configure
@@ -17235,44 +17235,6 @@ if test "x$ac_cv_cflags__Werror" = xyes; then :
   EXTRACFLAGS="$EXTRACFLAGS -Werror"
 fi
   fi
-
-    saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -Werror"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ms_hook_prologue attribute" >&5
-$as_echo_n "checking for ms_hook_prologue attribute... " >&6; }
-if ${ac_cv_have_ms_hook_prologue+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int __attribute__((__ms_hook_prologue__)) test(void) { return 0; }
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_have_ms_hook_prologue="yes"
-else
-  ac_cv_have_ms_hook_prologue="no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ms_hook_prologue" >&5
-$as_echo "$ac_cv_have_ms_hook_prologue" >&6; }
-  CFLAGS="$saved_CFLAGS"
-  if test "$ac_cv_have_ms_hook_prologue" = "yes"
-  then
-
-$as_echo "#define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__))" >>confdefs.h
-
-  else
-      $as_echo "#define DECLSPEC_HOTPATCH /* */" >>confdefs.h
-
-  fi
 fi
 
 
diff --git a/configure.ac b/configure.ac
index cd6e61a..0ad8417 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2031,21 +2031,6 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
   then
       WINE_TRY_CFLAGS([-Werror])
   fi
-
-  dnl Check for ms_hook_prologue support
-  saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -Werror"
-  AC_CACHE_CHECK([for ms_hook_prologue attribute], ac_cv_have_ms_hook_prologue,
-                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int __attribute__((__ms_hook_prologue__)) test(void) { return 0; }]])],
-                                   [ac_cv_have_ms_hook_prologue="yes"],[ac_cv_have_ms_hook_prologue="no"]))
-  CFLAGS="$saved_CFLAGS"
-  if test "$ac_cv_have_ms_hook_prologue" = "yes"
-  then
-      AC_DEFINE(DECLSPEC_HOTPATCH, [__attribute__((__ms_hook_prologue__))],
-                [Define to a function attribute for Microsoft hotpatch assembly prefix.])
-  else
-      AC_DEFINE(DECLSPEC_HOTPATCH, [/* */])
-  fi
 fi
 
 dnl **** Disable Fortify, it has too many false positives
diff --git a/include/config.h.in b/include/config.h.in
index aeb571a..8add980 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -4,9 +4,6 @@
 #define __WINE_CONFIG_H
 #ifndef WINE_CROSSTEST
 
-/* Define to a function attribute for Microsoft hotpatch assembly prefix. */
-#undef DECLSPEC_HOTPATCH
-
 /* Define to the file extension for executables. */
 #undef EXEEXT
 
diff --git a/include/winnt.h b/include/winnt.h
index 0e011cd..d0d3b2c 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -162,6 +162,12 @@ extern "C" {
 # define DECLSPEC_HIDDEN
 #endif
 
+#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))) && (defined(__i386__) || defined(__x86_64__))
+#define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__))
+#else
+#define DECLSPEC_HOTPATCH
+#endif
+
 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
 #define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
 #else




More information about the wine-cvs mailing list