From: Paul Eggert Date: Mon, 17 Dec 2018 17:31:08 +0000 (-0800) Subject: Assume ‘emacs’ is defined in Emacs-only code X-Git-Tag: emacs-27.0.90~3977 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4d77c4ac3b9c40c62b1505bcaa1e0377d63a4956;p=emacs.git Assume ‘emacs’ is defined in Emacs-only code * src/charset.c, src/coding.c, src/coding.h, src/gmalloc.c: * src/ralloc.c, src/regex-emacs.c: Simplify slightly by assuming that ‘emacs’ is defined. These modules have long been specific to Emacs, and are not used elsewhere. --- diff --git a/src/charset.c b/src/charset.c index 83f4de7ed24..8508b80677f 100644 --- a/src/charset.c +++ b/src/charset.c @@ -2328,8 +2328,6 @@ init_charset_once (void) charset_ksc5601 = -1; } -#ifdef emacs - /* Allocate an initial charset table that is large enough to handle Emacs while it is bootstrapping. As of September 2011, the size needs to be at least 166; make it a bit bigger to allow for future @@ -2430,5 +2428,3 @@ the value may be a list of mnemonics. */); MAX_5_BYTE_CHAR + 1); charset_unibyte = charset_iso_8859_1; } - -#endif /* emacs */ diff --git a/src/coding.c b/src/coding.c index c2945707e23..ba060878c7d 100644 --- a/src/coding.c +++ b/src/coding.c @@ -307,16 +307,12 @@ Lisp_Object Vcoding_system_hash_table; file and process), not for in-buffer or Lisp string encoding. */ static Lisp_Object system_eol_type; -#ifdef emacs - /* Coding-systems are handed between Emacs Lisp programs and C internal routines by the following three variables. */ /* Coding system to be used to encode text for terminal display when terminal coding system is nil. */ struct coding_system safe_terminal_coding; -#endif /* emacs */ - /* Two special coding systems. */ static Lisp_Object Vsjis_coding_system; static Lisp_Object Vbig5_coding_system; @@ -8478,7 +8474,6 @@ to_unicode (Lisp_Object str, Lisp_Object *buf) #endif /* WINDOWSNT || CYGWIN */ -#ifdef emacs /*** 8. Emacs Lisp library functions ***/ DEFUN ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0, @@ -10732,8 +10727,6 @@ coding system whose eol-type is N. */) return make_fixnum (n); } -#endif /* emacs */ - /*** 9. Post-amble ***/ @@ -10777,8 +10770,6 @@ init_coding_once (void) emacs_mule_bytes[EMACS_MULE_LEADING_CODE_PRIVATE_22] = 4; } -#ifdef emacs - void syms_of_coding (void) { @@ -11321,4 +11312,3 @@ internal character representation. */); #endif staticpro (&system_eol_type); } -#endif /* emacs */ diff --git a/src/coding.h b/src/coding.h index d2cf4d8a7ba..e984375bcc7 100644 --- a/src/coding.h +++ b/src/coding.h @@ -762,15 +762,10 @@ surrogates_to_codepoint (int low, int high) extern Lisp_Object preferred_coding_system (void); - -#ifdef emacs - /* Coding system to be used to encode text for terminal display when terminal coding system is nil. */ extern struct coding_system safe_terminal_coding; -#endif - extern char emacs_mule_bytes[256]; INLINE_HEADER_END diff --git a/src/gmalloc.c b/src/gmalloc.c index ebba789f610..c07ead741e6 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c @@ -36,9 +36,7 @@ License along with this library. If not, see . #include #endif -#ifdef emacs -# include "lisp.h" -#endif +#include "lisp.h" #include "ptr-bounds.h" @@ -2022,11 +2020,7 @@ mabort (enum mcheck_status status) #else fprintf (stderr, "mcheck: %s\n", msg); fflush (stderr); -# ifdef emacs emacs_abort (); -# else - abort (); -# endif #endif } diff --git a/src/ralloc.c b/src/ralloc.c index 046d5507342..4dc9fe348b0 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -26,11 +26,9 @@ along with GNU Emacs. If not, see . */ #include -#ifdef emacs -# include "lisp.h" -# include "blockinput.h" -# include -#endif +#include "lisp.h" +#include "blockinput.h" +#include #include "getpagesize.h" @@ -924,9 +922,7 @@ r_alloc_free (void **ptr) free_bloc (dead_bloc); *ptr = 0; -#ifdef emacs refill_memory_reserve (); -#endif } /* Given a pointer at address PTR to relocatable data, resize it to SIZE. @@ -1000,7 +996,7 @@ r_re_alloc (void **ptr, size_t size) } -#if defined (emacs) && defined (DOUG_LEA_MALLOC) +#ifdef DOUG_LEA_MALLOC /* Reinitialize the morecore hook variables after restarting a dumped Emacs. This is needed when using Doug Lea's malloc from GNU libc. */ diff --git a/src/regex-emacs.c b/src/regex-emacs.c index d19838a876e..5cb7bba158e 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -698,7 +698,6 @@ print_partial_compiled_pattern (re_char *start, re_char *end) fprintf (stderr, "/%d", mcnt); break; -# ifdef emacs case at_dot: fprintf (stderr, "/at_dot"); break; @@ -714,7 +713,6 @@ print_partial_compiled_pattern (re_char *start, re_char *end) mcnt = *p++; fprintf (stderr, "/%d", mcnt); break; -# endif /* emacs */ case begbuf: fprintf (stderr, "/begbuf"); @@ -753,9 +751,6 @@ print_compiled_pattern (struct re_pattern_buffer *bufp) printf ("re_nsub: %zu\t", bufp->re_nsub); printf ("regs_alloc: %d\t", bufp->regs_allocated); printf ("can_be_null: %d\t", bufp->can_be_null); -#ifndef emacs - printf ("syntax: %lx\n", bufp->syntax); -#endif fflush (stdout); /* Perhaps we should print the translate table? */ }