Commit 4d77c4ac authored by Paul Eggert's avatar Paul Eggert

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.
parent 739dca78
Pipeline #305 failed with stage
in 6 seconds
......@@ -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 */
......@@ -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 */
......@@ -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
......
......@@ -36,9 +36,7 @@ License along with this library. If not, see <https://www.gnu.org/licenses/>.
#include <pthread.h>
#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
}
......
......@@ -26,11 +26,9 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <stddef.h>
#ifdef emacs
# include "lisp.h"
# include "blockinput.h"
# include <unistd.h>
#endif
#include "lisp.h"
#include "blockinput.h"
#include <unistd.h>
#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. */
......
......@@ -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? */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment