From 3438fe218c77633ee2c5f106e3a335f906347247 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 27 Jul 2012 12:24:34 +0300 Subject: [PATCH] Fix failure to compile on Windows due to 2012-07-27T06:04:35Z!dmantipov@yandex.ru. src/lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for enumeration constants, as PURE and HEAP are too general, and clash with other headers and sources, such as gmalloc.c and the MS-Windows system headers. All users changed. --- src/ChangeLog | 7 +++++++ src/alloc.c | 10 +++++----- src/buffer.c | 2 +- src/callint.c | 2 +- src/charset.c | 2 +- src/coding.c | 2 +- src/keymap.c | 4 ++-- src/lisp.h | 2 +- src/search.c | 4 ++-- src/syntax.c | 2 +- src/w32.c | 4 ++-- src/w32fns.c | 4 ++-- src/xdisp.c | 4 ++-- src/xfns.c | 2 +- 14 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 93697303cb..54b34eb5c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-07-27 Eli Zaretskii + + * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for + enumeration constants, as PURE and HEAP are too general, and clash + with other headers and sources, such as gmalloc.c and the + MS-Windows system headers. All users changed. + 2012-07-27 Dmitry Antipov Revert last save_excursion_save and save_excursion_restore changes. diff --git a/src/alloc.c b/src/alloc.c index c7936921a0..27426cdff6 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2813,7 +2813,7 @@ list5 (Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, L /* Make a list of COUNT Lisp_Objects, where ARG is the first one. Allocate conses from pure space if TYPE - is PURE, or allocate as usual if type is HEAP. */ + is CONSTYPE_PURE, or allocate as usual if type is CONSTYPE_HEAP. */ Lisp_Object listn (enum constype type, ptrdiff_t count, Lisp_Object arg, ...) @@ -2834,9 +2834,9 @@ listn (enum constype type, ptrdiff_t count, Lisp_Object arg, ...) for (i = 0, val = Qnil; i < count; i++) { - if (type == PURE) + if (type == CONSTYPE_PURE) val = pure_cons (objp[i], val); - else if (type == HEAP) + else if (type == CONSTYPE_HEAP) val = Fcons (objp[i], val); else abort (); @@ -6676,7 +6676,7 @@ Frames, windows, buffers, and subprocesses count as vectors (but the contents of a buffer's text do not count here). */) (void) { - return listn (HEAP, 8, + return listn (CONSTYPE_HEAP, 8, bounded_number (cons_cells_consed), bounded_number (floats_consed), bounded_number (vector_cells_consed), @@ -6865,7 +6865,7 @@ do hash-consing of the objects allocated to pure space. */); /* We build this in advance because if we wait until we need it, we might not be able to allocate the memory to hold it. */ Vmemory_signal_data - = listn (PURE, 2, Qerror, + = listn (CONSTYPE_PURE, 2, Qerror, build_pure_c_string ("Memory exhausted--use M-x save-some-buffers then exit and restart Emacs")); DEFVAR_LISP ("memory-full", Vmemory_full, diff --git a/src/buffer.c b/src/buffer.c index c2afd7f4a5..5e45882b89 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5212,7 +5212,7 @@ syms_of_buffer (void) DEFSYM (Qkill_buffer_query_functions, "kill-buffer-query-functions"); Fput (Qprotected_field, Qerror_conditions, - listn (PURE, 2, Qprotected_field, Qerror)); + listn (CONSTYPE_PURE, 2, Qprotected_field, Qerror)); Fput (Qprotected_field, Qerror_message, build_pure_c_string ("Attempt to modify a protected field")); diff --git a/src/callint.c b/src/callint.c index 4454b1fdb1..4b53b5df34 100644 --- a/src/callint.c +++ b/src/callint.c @@ -888,7 +888,7 @@ syms_of_callint (void) callint_message = Qnil; staticpro (&callint_message); - preserved_fns = listn (PURE, 4, + preserved_fns = listn (CONSTYPE_PURE, 4, intern_c_string ("region-beginning"), intern_c_string ("region-end"), intern_c_string ("point"), diff --git a/src/charset.c b/src/charset.c index ae82254400..b621109b75 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1283,7 +1283,7 @@ define_charset_internal (Lisp_Object name, args[charset_arg_unify_map] = Qnil; args[charset_arg_plist] = - listn (HEAP, 14, + listn (CONSTYPE_HEAP, 14, intern_c_string (":name"), args[charset_arg_name], intern_c_string (":dimension"), diff --git a/src/coding.c b/src/coding.c index 8b858aa218..7b178b0ce1 100644 --- a/src/coding.c +++ b/src/coding.c @@ -10411,7 +10411,7 @@ syms_of_coding (void) DEFSYM (Qcoding_system_error, "coding-system-error"); Fput (Qcoding_system_error, Qerror_conditions, - listn (PURE, 2, Qcoding_system_error, Qerror)); + listn (CONSTYPE_PURE, 2, Qcoding_system_error, Qerror)); Fput (Qcoding_system_error, Qerror_message, build_pure_c_string ("Invalid coding system")); diff --git a/src/keymap.c b/src/keymap.c index d86a4cd74d..6cc7670054 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -3702,7 +3702,7 @@ syms_of_keymap (void) Fset (intern_c_string ("ctl-x-map"), control_x_map); Ffset (intern_c_string ("Control-X-prefix"), control_x_map); - exclude_keys = listn (PURE, 5, + exclude_keys = listn (CONSTYPE_PURE, 5, pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")), pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")), pure_cons (build_pure_c_string ("RET"), build_pure_c_string ("\\r")), @@ -3760,7 +3760,7 @@ be preferred. */); where_is_preferred_modifier = 0; staticpro (&Vmouse_events); - Vmouse_events = listn (PURE, 9, + Vmouse_events = listn (CONSTYPE_PURE, 9, intern_c_string ("menu-bar"), intern_c_string ("tool-bar"), intern_c_string ("header-line"), diff --git a/src/lisp.h b/src/lisp.h index f0129f05ef..80a9ab343c 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2643,7 +2643,7 @@ extern Lisp_Object list3 (Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object list4 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object list5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); -enum constype {HEAP, PURE}; +enum constype {CONSTYPE_HEAP, CONSTYPE_PURE}; extern Lisp_Object listn (enum constype, ptrdiff_t, Lisp_Object, ...); extern _Noreturn void string_overflow (void); extern Lisp_Object make_string (const char *, ptrdiff_t); diff --git a/src/search.c b/src/search.c index c4329dcdf3..480d0b75c7 100644 --- a/src/search.c +++ b/src/search.c @@ -3054,12 +3054,12 @@ syms_of_search (void) DEFSYM (Qinvalid_regexp, "invalid-regexp"); Fput (Qsearch_failed, Qerror_conditions, - listn (PURE, 2, Qsearch_failed, Qerror)); + listn (CONSTYPE_PURE, 2, Qsearch_failed, Qerror)); Fput (Qsearch_failed, Qerror_message, build_pure_c_string ("Search failed")); Fput (Qinvalid_regexp, Qerror_conditions, - listn (PURE, 2, Qinvalid_regexp, Qerror)); + listn (CONSTYPE_PURE, 2, Qinvalid_regexp, Qerror)); Fput (Qinvalid_regexp, Qerror_message, build_pure_c_string ("Invalid regexp")); diff --git a/src/syntax.c b/src/syntax.c index 1e57c00e51..14bec9a9c2 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -3473,7 +3473,7 @@ syms_of_syntax (void) DEFSYM (Qscan_error, "scan-error"); Fput (Qscan_error, Qerror_conditions, - listn (PURE, 2, Qscan_error, Qerror)); + listn (CONSTYPE_PURE, 2, Qscan_error, Qerror)); Fput (Qscan_error, Qerror_message, build_pure_c_string ("Scan error")); diff --git a/src/w32.c b/src/w32.c index fe1007fced..55b076e80f 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1722,8 +1722,8 @@ init_environment (char ** argv) dwType = REG_EXPAND_SZ; dont_free = 1; if (!strcmp (env_vars[i].name, "HOME") && !appdata) - Vdelayed_warnings_list - = Fcons (listn (HEAP, 2, + Vdelayed_warnings_list + = Fcons (listn (CONSTYPE_HEAP, 2, intern ("initialization"), build_string ("Setting HOME to C:\\ by default is deprecated")), Vdelayed_warnings_list); diff --git a/src/w32fns.c b/src/w32fns.c index 265af7378c..1b1c500134 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6544,7 +6544,7 @@ The following %-sequences are provided: remain = build_string (buffer); } - status = listn (HEAP, 8, + status = listn (CONSTYPE_HEAP, 8, Fcons (make_number ('L'), line_status), Fcons (make_number ('B'), battery_status), Fcons (make_number ('b'), battery_status_symbol), @@ -6794,7 +6794,7 @@ syms_of_w32fns (void) Fput (Qundefined_color, Qerror_conditions, - listn (PURE, 2, Qundefined_color, Qerror)); + listn (CONSTYPE_PURE, 2, Qundefined_color, Qerror)); Fput (Qundefined_color, Qerror_message, build_pure_c_string ("Undefined color")); diff --git a/src/xdisp.c b/src/xdisp.c index aac34d35ef..ecb9f0d50c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -28932,10 +28932,10 @@ and is used only on frames for which no explicit name has been set \(see `modify-frame-parameters'). */); Vicon_title_format = Vframe_title_format - = listn (PURE, 3, + = listn (CONSTYPE_PURE, 3, intern_c_string ("multiple-frames"), build_pure_c_string ("%b"), - listn (PURE, 4, + listn (CONSTYPE_PURE, 4, empty_unibyte_string, intern_c_string ("invocation-name"), build_pure_c_string ("@"), diff --git a/src/xfns.c b/src/xfns.c index cd29dabc71..c8c96b642f 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5822,7 +5822,7 @@ syms_of_xfns (void) /* This is the end of symbol initialization. */ Fput (Qundefined_color, Qerror_conditions, - listn (PURE, 2, Qundefined_color, Qerror)); + listn (CONSTYPE_PURE, 2, Qundefined_color, Qerror)); Fput (Qundefined_color, Qerror_message, build_pure_c_string ("Undefined color")); -- 2.20.1