aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2018-12-17 09:31:08 -0800
committerPaul Eggert2018-12-17 09:31:53 -0800
commit4d77c4ac3b9c40c62b1505bcaa1e0377d63a4956 (patch)
tree6ee9aff2af6310152d545996fbc52dee6915d884 /src
parent739dca7818514f1b7c318fd195f90535a416f57f (diff)
downloademacs-4d77c4ac3b9c40c62b1505bcaa1e0377d63a4956.tar.gz
emacs-4d77c4ac3b9c40c62b1505bcaa1e0377d63a4956.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/charset.c4
-rw-r--r--src/coding.c10
-rw-r--r--src/coding.h5
-rw-r--r--src/gmalloc.c8
-rw-r--r--src/ralloc.c12
-rw-r--r--src/regex-emacs.c5
6 files changed, 5 insertions, 39 deletions
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)
2328 charset_ksc5601 = -1; 2328 charset_ksc5601 = -1;
2329} 2329}
2330 2330
2331#ifdef emacs
2332
2333/* Allocate an initial charset table that is large enough to handle 2331/* Allocate an initial charset table that is large enough to handle
2334 Emacs while it is bootstrapping. As of September 2011, the size 2332 Emacs while it is bootstrapping. As of September 2011, the size
2335 needs to be at least 166; make it a bit bigger to allow for future 2333 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. */);
2430 MAX_5_BYTE_CHAR + 1); 2428 MAX_5_BYTE_CHAR + 1);
2431 charset_unibyte = charset_iso_8859_1; 2429 charset_unibyte = charset_iso_8859_1;
2432} 2430}
2433
2434#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;
307 file and process), not for in-buffer or Lisp string encoding. */ 307 file and process), not for in-buffer or Lisp string encoding. */
308static Lisp_Object system_eol_type; 308static Lisp_Object system_eol_type;
309 309
310#ifdef emacs
311
312/* Coding-systems are handed between Emacs Lisp programs and C internal 310/* Coding-systems are handed between Emacs Lisp programs and C internal
313 routines by the following three variables. */ 311 routines by the following three variables. */
314/* Coding system to be used to encode text for terminal display when 312/* Coding system to be used to encode text for terminal display when
315 terminal coding system is nil. */ 313 terminal coding system is nil. */
316struct coding_system safe_terminal_coding; 314struct coding_system safe_terminal_coding;
317 315
318#endif /* emacs */
319
320/* Two special coding systems. */ 316/* Two special coding systems. */
321static Lisp_Object Vsjis_coding_system; 317static Lisp_Object Vsjis_coding_system;
322static Lisp_Object Vbig5_coding_system; 318static Lisp_Object Vbig5_coding_system;
@@ -8478,7 +8474,6 @@ to_unicode (Lisp_Object str, Lisp_Object *buf)
8478#endif /* WINDOWSNT || CYGWIN */ 8474#endif /* WINDOWSNT || CYGWIN */
8479 8475
8480 8476
8481#ifdef emacs
8482/*** 8. Emacs Lisp library functions ***/ 8477/*** 8. Emacs Lisp library functions ***/
8483 8478
8484DEFUN ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0, 8479DEFUN ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0,
@@ -10732,8 +10727,6 @@ coding system whose eol-type is N. */)
10732 return make_fixnum (n); 10727 return make_fixnum (n);
10733} 10728}
10734 10729
10735#endif /* emacs */
10736
10737 10730
10738/*** 9. Post-amble ***/ 10731/*** 9. Post-amble ***/
10739 10732
@@ -10777,8 +10770,6 @@ init_coding_once (void)
10777 emacs_mule_bytes[EMACS_MULE_LEADING_CODE_PRIVATE_22] = 4; 10770 emacs_mule_bytes[EMACS_MULE_LEADING_CODE_PRIVATE_22] = 4;
10778} 10771}
10779 10772
10780#ifdef emacs
10781
10782void 10773void
10783syms_of_coding (void) 10774syms_of_coding (void)
10784{ 10775{
@@ -11321,4 +11312,3 @@ internal character representation. */);
11321#endif 11312#endif
11322 staticpro (&system_eol_type); 11313 staticpro (&system_eol_type);
11323} 11314}
11324#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)
762 762
763extern Lisp_Object preferred_coding_system (void); 763extern Lisp_Object preferred_coding_system (void);
764 764
765
766#ifdef emacs
767
768/* Coding system to be used to encode text for terminal display when 765/* Coding system to be used to encode text for terminal display when
769 terminal coding system is nil. */ 766 terminal coding system is nil. */
770extern struct coding_system safe_terminal_coding; 767extern struct coding_system safe_terminal_coding;
771 768
772#endif
773
774extern char emacs_mule_bytes[256]; 769extern char emacs_mule_bytes[256];
775 770
776INLINE_HEADER_END 771INLINE_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 <https://www.gnu.org/licenses/>.
36#include <pthread.h> 36#include <pthread.h>
37#endif 37#endif
38 38
39#ifdef emacs 39#include "lisp.h"
40# include "lisp.h"
41#endif
42 40
43#include "ptr-bounds.h" 41#include "ptr-bounds.h"
44 42
@@ -2022,11 +2020,7 @@ mabort (enum mcheck_status status)
2022#else 2020#else
2023 fprintf (stderr, "mcheck: %s\n", msg); 2021 fprintf (stderr, "mcheck: %s\n", msg);
2024 fflush (stderr); 2022 fflush (stderr);
2025# ifdef emacs
2026 emacs_abort (); 2023 emacs_abort ();
2027# else
2028 abort ();
2029# endif
2030#endif 2024#endif
2031} 2025}
2032 2026
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 <https://www.gnu.org/licenses/>. */
26 26
27#include <stddef.h> 27#include <stddef.h>
28 28
29#ifdef emacs 29#include "lisp.h"
30# include "lisp.h" 30#include "blockinput.h"
31# include "blockinput.h" 31#include <unistd.h>
32# include <unistd.h>
33#endif
34 32
35#include "getpagesize.h" 33#include "getpagesize.h"
36 34
@@ -924,9 +922,7 @@ r_alloc_free (void **ptr)
924 free_bloc (dead_bloc); 922 free_bloc (dead_bloc);
925 *ptr = 0; 923 *ptr = 0;
926 924
927#ifdef emacs
928 refill_memory_reserve (); 925 refill_memory_reserve ();
929#endif
930} 926}
931 927
932/* Given a pointer at address PTR to relocatable data, resize it to SIZE. 928/* 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)
1000} 996}
1001 997
1002 998
1003#if defined (emacs) && defined (DOUG_LEA_MALLOC) 999#ifdef DOUG_LEA_MALLOC
1004 1000
1005/* Reinitialize the morecore hook variables after restarting a dumped 1001/* Reinitialize the morecore hook variables after restarting a dumped
1006 Emacs. This is needed when using Doug Lea's malloc from GNU libc. */ 1002 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)
698 fprintf (stderr, "/%d", mcnt); 698 fprintf (stderr, "/%d", mcnt);
699 break; 699 break;
700 700
701# ifdef emacs
702 case at_dot: 701 case at_dot:
703 fprintf (stderr, "/at_dot"); 702 fprintf (stderr, "/at_dot");
704 break; 703 break;
@@ -714,7 +713,6 @@ print_partial_compiled_pattern (re_char *start, re_char *end)
714 mcnt = *p++; 713 mcnt = *p++;
715 fprintf (stderr, "/%d", mcnt); 714 fprintf (stderr, "/%d", mcnt);
716 break; 715 break;
717# endif /* emacs */
718 716
719 case begbuf: 717 case begbuf:
720 fprintf (stderr, "/begbuf"); 718 fprintf (stderr, "/begbuf");
@@ -753,9 +751,6 @@ print_compiled_pattern (struct re_pattern_buffer *bufp)
753 printf ("re_nsub: %zu\t", bufp->re_nsub); 751 printf ("re_nsub: %zu\t", bufp->re_nsub);
754 printf ("regs_alloc: %d\t", bufp->regs_allocated); 752 printf ("regs_alloc: %d\t", bufp->regs_allocated);
755 printf ("can_be_null: %d\t", bufp->can_be_null); 753 printf ("can_be_null: %d\t", bufp->can_be_null);
756#ifndef emacs
757 printf ("syntax: %lx\n", bufp->syntax);
758#endif
759 fflush (stdout); 754 fflush (stdout);
760 /* Perhaps we should print the translate table? */ 755 /* Perhaps we should print the translate table? */
761} 756}