aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2018-04-03 17:30:48 -0700
committerPaul Eggert2018-04-03 17:32:16 -0700
commit9b0e8a4c6b540dcb962607763846040942858c5a (patch)
tree42524279c8d6bbf3f61e5588351ea6c4e3f03a85 /src
parent3deaac1bd9569fd57185e9e6256cc8419323ba78 (diff)
downloademacs-9b0e8a4c6b540dcb962607763846040942858c5a.tar.gz
emacs-9b0e8a4c6b540dcb962607763846040942858c5a.zip
Pacify GCC when --enable-profiling
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/conf_post.h4
-rw-r--r--src/dispnew.c4
-rw-r--r--src/emacs.c16
-rw-r--r--src/lisp.h3
4 files changed, 12 insertions, 15 deletions
diff --git a/src/conf_post.h b/src/conf_post.h
index 69f686d72df..00e283d289c 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -344,6 +344,10 @@ extern int emacs_setenv_TZ (char const *);
344# define vfork fork 344# define vfork fork
345#endif 345#endif
346 346
347#if ! (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__)
348# undef PROFILING
349#endif
350
347/* Some versions of GNU/Linux define noinline in their headers. */ 351/* Some versions of GNU/Linux define noinline in their headers. */
348#ifdef noinline 352#ifdef noinline
349#undef noinline 353#undef noinline
diff --git a/src/dispnew.c b/src/dispnew.c
index 56f125218dc..324c05ddc4c 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -234,9 +234,7 @@ DEFUN ("dump-redisplay-history", Fdump_redisplay_history,
234#endif /* GLYPH_DEBUG */ 234#endif /* GLYPH_DEBUG */
235 235
236 236
237#if (defined PROFILING \ 237#if defined PROFILING && !HAVE___EXECUTABLE_START
238 && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__) \
239 && !HAVE___EXECUTABLE_START)
240/* This function comes first in the Emacs executable and is used only 238/* This function comes first in the Emacs executable and is used only
241 to estimate the text start for profiling. */ 239 to estimate the text start for profiling. */
242void 240void
diff --git a/src/emacs.c b/src/emacs.c
index 8ea61b71fb7..f25e6126642 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -94,10 +94,14 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
94#include "getpagesize.h" 94#include "getpagesize.h"
95#include "gnutls.h" 95#include "gnutls.h"
96 96
97#if (defined PROFILING \ 97#ifdef PROFILING
98 && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__))
99# include <sys/gmon.h> 98# include <sys/gmon.h>
100extern void moncontrol (int mode); 99extern void moncontrol (int mode);
100# ifdef __MINGW32__
101extern unsigned char etext asm ("etext");
102# else
103extern char etext;
104# endif
101#endif 105#endif
102 106
103#ifdef HAVE_SETLOCALE 107#ifdef HAVE_SETLOCALE
@@ -1700,23 +1704,15 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1700 GNU/Linux and MinGW. It might work on some other systems too. 1704 GNU/Linux and MinGW. It might work on some other systems too.
1701 Give it a try and tell us if it works on your system. To compile 1705 Give it a try and tell us if it works on your system. To compile
1702 for profiling, use the configure option --enable-profiling. */ 1706 for profiling, use the configure option --enable-profiling. */
1703#if defined (__FreeBSD__) || defined (GNU_LINUX) || defined (__MINGW32__)
1704#ifdef PROFILING 1707#ifdef PROFILING
1705 if (initialized) 1708 if (initialized)
1706 { 1709 {
1707#ifdef __MINGW32__
1708 extern unsigned char etext asm ("etext");
1709#else
1710 extern char etext;
1711#endif
1712
1713 atexit (_mcleanup); 1710 atexit (_mcleanup);
1714 monstartup ((uintptr_t) __executable_start, (uintptr_t) &etext); 1711 monstartup ((uintptr_t) __executable_start, (uintptr_t) &etext);
1715 } 1712 }
1716 else 1713 else
1717 moncontrol (0); 1714 moncontrol (0);
1718#endif 1715#endif
1719#endif
1720 1716
1721 initialized = 1; 1717 initialized = 1;
1722 1718
diff --git a/src/lisp.h b/src/lisp.h
index c931d9c8f05..a18b64a588f 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3596,8 +3596,7 @@ extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
3596extern void syms_of_insdel (void); 3596extern void syms_of_insdel (void);
3597 3597
3598/* Defined in dispnew.c. */ 3598/* Defined in dispnew.c. */
3599#if (defined PROFILING \ 3599#ifdef PROFILING
3600 && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__))
3601_Noreturn void __executable_start (void); 3600_Noreturn void __executable_start (void);
3602#endif 3601#endif
3603extern Lisp_Object Vwindow_system; 3602extern Lisp_Object Vwindow_system;