diff options
| author | Gerd Möllmann | 2024-07-11 06:15:06 +0200 |
|---|---|---|
| committer | Gerd Möllmann | 2024-07-11 06:17:54 +0200 |
| commit | d73e2151988a03173d9a4570f338ae75fde5c6ec (patch) | |
| tree | 63b8d03001a758d446ef7f1df7758c4cb4557999 /src/alloc.c | |
| parent | 50fe7a3410a761af6ac70d3a01ff8d0e68791513 (diff) | |
| download | emacs-d73e2151988a03173d9a4570f338ae75fde5c6ec.tar.gz emacs-d73e2151988a03173d9a4570f338ae75fde5c6ec.zip | |
Fix init_strings for non-MPS build in my fork
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index dc2f3af0b6f..61bb95731a8 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1772,9 +1772,26 @@ static void | |||
| 1772 | init_strings (void) | 1772 | init_strings (void) |
| 1773 | { | 1773 | { |
| 1774 | #ifdef IN_MY_FORK | 1774 | #ifdef IN_MY_FORK |
| 1775 | #ifdef HAVE_MPS | ||
| 1775 | empty_multibyte_string = igc_make_multibyte_string (0, 0, false); | 1776 | empty_multibyte_string = igc_make_multibyte_string (0, 0, false); |
| 1776 | empty_unibyte_string = igc_make_unibyte_string (0, 0, false); | 1777 | empty_unibyte_string = igc_make_unibyte_string (0, 0, false); |
| 1777 | #else | 1778 | #else |
| 1779 | /* String allocation code will return one of 'empty_*ibyte_string' | ||
| 1780 | when asked to construct a new 0-length string, so in order to build | ||
| 1781 | those special cases, we have to do it "by hand". */ | ||
| 1782 | struct Lisp_String *ems = allocate_string (); | ||
| 1783 | struct Lisp_String *eus = allocate_string (); | ||
| 1784 | ems->u.s.intervals = NULL; | ||
| 1785 | eus->u.s.intervals = NULL; | ||
| 1786 | allocate_string_data (ems, 0, 0, false, false); | ||
| 1787 | allocate_string_data (eus, 0, 0, false, false); | ||
| 1788 | /* We can't use 'STRING_SET_UNIBYTE' because this one includes a hack | ||
| 1789 | * to redirect its arg to 'empty_unibyte_string' when nbytes == 0. */ | ||
| 1790 | eus->u.s.size_byte = -1; | ||
| 1791 | XSETSTRING (empty_multibyte_string, ems); | ||
| 1792 | XSETSTRING (empty_unibyte_string, eus); | ||
| 1793 | #endif | ||
| 1794 | #else | ||
| 1778 | empty_unibyte_string = make_pure_string ("", 0, 0, 0); | 1795 | empty_unibyte_string = make_pure_string ("", 0, 0, 0); |
| 1779 | empty_multibyte_string = make_pure_string ("", 0, 0, 1); | 1796 | empty_multibyte_string = make_pure_string ("", 0, 0, 1); |
| 1780 | #endif | 1797 | #endif |