]> git.eshelyaron.com Git - emacs.git/commitdiff
Pacify GCC when --enable-profiling
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Apr 2018 00:30:48 +0000 (17:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Apr 2018 00:32:16 +0000 (17:32 -0700)
* src/conf_post.h (PROFILING): Undef if not on a platform that
supports it.  Simplify uses accordingly.
* src/emacs.c (etext) [PROFILING]:
Declare at top level to avoid GCC warning.

src/conf_post.h
src/dispnew.c
src/emacs.c
src/lisp.h

index 69f686d72df3d28b5b7fe2216d84191cfffde172..00e283d289c18fd243855411f8710bf27b326165 100644 (file)
@@ -344,6 +344,10 @@ extern int emacs_setenv_TZ (char const *);
 # define vfork fork
 #endif
 
+#if ! (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__)
+# undef PROFILING
+#endif
+
 /* Some versions of GNU/Linux define noinline in their headers.  */
 #ifdef noinline
 #undef noinline
index 56f125218dc64757f7a2598d5fa3e4f1ba9e2655..324c05ddc4c45e3184e597273f94f1924eeedcbf 100644 (file)
@@ -234,9 +234,7 @@ DEFUN ("dump-redisplay-history", Fdump_redisplay_history,
 #endif /* GLYPH_DEBUG */
 
 
-#if (defined PROFILING \
-     && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__) \
-     && !HAVE___EXECUTABLE_START)
+#if defined PROFILING && !HAVE___EXECUTABLE_START
 /* This function comes first in the Emacs executable and is used only
    to estimate the text start for profiling.  */
 void
index 8ea61b71fb73d19af9ed7c72cb19911eaa457812..f25e6126642cd2765d5c7202af735298ecc32680 100644 (file)
@@ -94,10 +94,14 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include "getpagesize.h"
 #include "gnutls.h"
 
-#if (defined PROFILING \
-     && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__))
+#ifdef PROFILING
 # include <sys/gmon.h>
 extern void moncontrol (int mode);
+# ifdef __MINGW32__
+extern unsigned char etext asm ("etext");
+# else
+extern char etext;
+# endif
 #endif
 
 #ifdef HAVE_SETLOCALE
@@ -1700,22 +1704,14 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
      GNU/Linux and MinGW.  It might work on some other systems too.
      Give it a try and tell us if it works on your system.  To compile
      for profiling, use the configure option --enable-profiling.  */
-#if defined (__FreeBSD__) || defined (GNU_LINUX) || defined (__MINGW32__)
 #ifdef PROFILING
   if (initialized)
     {
-#ifdef __MINGW32__
-      extern unsigned char etext asm ("etext");
-#else
-      extern char etext;
-#endif
-
       atexit (_mcleanup);
       monstartup ((uintptr_t) __executable_start, (uintptr_t) &etext);
     }
   else
     moncontrol (0);
-#endif
 #endif
 
   initialized = 1;
index c931d9c8f05d0f43750cbb7a42b8056f9580fdb9..a18b64a588f6fa6d97b2651e460e4652cc0feaf3 100644 (file)
@@ -3596,8 +3596,7 @@ extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
 extern void syms_of_insdel (void);
 
 /* Defined in dispnew.c.  */
-#if (defined PROFILING \
-     && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__))
+#ifdef PROFILING
 _Noreturn void __executable_start (void);
 #endif
 extern Lisp_Object Vwindow_system;