comparison src/lisp.h @ 4932:8b63e21b0436

fix compile issues with gcc 4 -------------------- ChangeLog entries follow: -------------------- ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * aclocal.m4 (XE_SHLIB_STUFF): Use -export-all-symbols instead of -export-dynamic on PE targets (Cygwin and MinGW). * configure.ac (XE_EXPAND_VARIABLE): * configure.ac (TAB): Create variable XEMACS_CC_GPP to check whether we're running g++. Don't just check for an executable called `g++' -- it might be called g++-4 or whatever. Instead, check for either named `g++*' or claiming to be g++ when called with --version. Rewrite code do use the variable. Add -fno-strict-aliasing to optimization flags when GCC and optimized, and in all cases with g++, since under these circumstances strict aliasing is otherwise assumed, and XEmacs can't easily be made to respect its restrictions. * configure: Regenerate. lib-src/ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * fakemail.c (args_size): * fakemail.c (parse_header): * ootags.c (C_entries): Fix warnings about possible use of uninitialized vars. lwlib/ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * xlwgauge.c (GaugeResize): * xlwgauge.c (GaugeSize): Fix warnings about possible use of uninitialized vars. modules/ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * postgresql/postgresql.c (CHECK_LIVE_CONNECTION): * postgresql/postgresql.c (print_pgconn): * postgresql/postgresql.c (Fpq_connectdb): * postgresql/postgresql.c (Fpq_connect_start): * postgresql/postgresql.c (Fpq_exec): * postgresql/postgresql.c (Fpq_get_result): Fix g++ 4.3 complaints about implicit conversions of string literals (const char *) to char *. src/ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * chartab.c (decode_char_table_range): * extents.c (extent_fragment_update): * objects-msw.c (initialize_font_instance): * process.c (Fgetenv): * redisplay-output.c (get_next_display_block): Fix warnings about possible use of uninitialized vars. * compiler.h: * compiler.h (REGISTER): * event-stream.c (is_scrollbar_event): * window.c (window_scrollbar_width): * window.c (window_scrollbar_height): * window.c (window_left_window_gutter_width): * window.c (window_right_window_gutter_width): Add USED_IF_SCROLLBARS. Use it to fix warnings about unused vars when --with-scrollbars=no. * config.h.in: Change comment to explain better why DECLARE_INLINE_HEADER is needed. * dialog-msw.c: * emacs.c (SHEBANG_EXE_PROGNAME_LENGTH): * emacs.c (main_1): * event-msw.c (struct mswin_message_debug): * event-msw.c (debug_output_mswin_message): * font-mgr.c: * font-mgr.c (Ffc_config_filename): * glyphs-msw.c (struct): * glyphs-msw.c (bitmap_table): * glyphs-x.c (update_widget_face): * intl-win32.c (struct lang_to_string): * intl-win32.c (lang_to_string_table): * nas.c: * objects-xlike-inc.c: * objects-xlike-inc.c (xft_find_charset_font): * syswindows.h: * win32.c (mswindows_output_last_error): Fix g++ 4.3 complaints about implicit conversions of string literals (const char *) to char *. * lisp.h: G++ 4.3 needs #include <limits> to avoid errors about min/max. * lisp.h (disabled_assert_with_message): Use disabled_assert* whenever asserts are disabled. Rewrite disabled_assert* to avoid complaints about unused vars by pretending to use the vars but casting them to (void). Remove code that defined assert() weirdly if DEBUG_XEMACS but not USE_ASSERTIONS -- configure sets USE_ASSERTIONS automatically when DEBUG_XEMACS, and if the user has forced it off, then so be it. * lisp.h (SYMBOL_KEYWORD): Put some of the combined `extern Lisp_Object's back under the file they are declared in. Cosmetic fix. * number.h: Remove `extern Lisp_Object' decls that duplicate lisp.h, since they have different C vs. C++ linkage.
author Ben Wing <ben@xemacs.org>
date Sun, 24 Jan 2010 22:04:58 -0600
parents b5ad8cf9f6e4
children 19a72041c5ed
comparison
equal deleted inserted replaced
4931:8a08cf0b7583 4932:8b63e21b0436
104 #include <ctype.h> 104 #include <ctype.h>
105 #include <stdarg.h> 105 #include <stdarg.h>
106 #include <stddef.h> /* offsetof */ 106 #include <stddef.h> /* offsetof */
107 #include <sys/types.h> 107 #include <sys/types.h>
108 #include <limits.h> 108 #include <limits.h>
109 #ifdef __cplusplus
110 #include <limits> /* necessary for max()/min() under G++ 4 */
111 #endif
112
109 113
110 /* -------------------------- error-checking ------------------------ */ 114 /* -------------------------- error-checking ------------------------ */
111 115
112 /* The large categories established by configure can be subdivided into 116 /* The large categories established by configure can be subdivided into
113 smaller subcategories, for problems in specific modules. You can't 117 smaller subcategories, for problems in specific modules. You can't
1259 warnings. It's pointless to force all that code to be rewritten, with 1263 warnings. It's pointless to force all that code to be rewritten, with
1260 added ifdefs. Any reasonable compiler will eliminate an expression with 1264 added ifdefs. Any reasonable compiler will eliminate an expression with
1261 no effects. We keep this abstracted out like this in case we want to 1265 no effects. We keep this abstracted out like this in case we want to
1262 change it in the future. */ 1266 change it in the future. */
1263 #define disabled_assert(x) ((void) (x)) 1267 #define disabled_assert(x) ((void) (x))
1264 #define disabled_assert_with_message(x, msg) disabled_assert (x) 1268 #define disabled_assert_with_message(x, msg) ((void) msg, disabled_assert (x))
1265 #define disabled_assert_at_line(x, file, line) disabled_assert (x) 1269 #define disabled_assert_at_line(x, file, line) \
1270 ((void) file, (void) line, disabled_assert (x))
1266 1271
1267 #ifdef USE_ASSERTIONS 1272 #ifdef USE_ASSERTIONS
1268 # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x)) 1273 # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x))
1269 # define assert_with_message(x, msg) \ 1274 # define assert_with_message(x, msg) \
1270 ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, msg)) 1275 ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, msg))
1271 # define assert_at_line(x, file, line) \ 1276 # define assert_at_line(x, file, line) \
1272 ((x) ? (void) 0 : assert_failed (file, line, #x)) 1277 ((x) ? (void) 0 : assert_failed (file, line, #x))
1273 #elif defined (DEBUG_XEMACS)
1274 # define assert(x) ((x) ? (void) 0 : (void) ABORT ())
1275 # define assert_with_message(x, msg) assert (x)
1276 # define assert_at_line(x, file, line) assert (x)
1277 #else 1278 #else
1278 /* This used to be ((void) (0)) but that triggers lots of unused variable 1279 /* This used to be ((void) (0)) but that triggers lots of unused variable
1279 warnings. It's pointless to force all that code to be rewritten, with 1280 warnings. It's pointless to force all that code to be rewritten, with
1280 added ifdefs. Any reasonable compiler will eliminate an expression with 1281 added ifdefs. Any reasonable compiler will eliminate an expression with
1281 no effects. */ 1282 no effects. */
1282 # define assert(x) ((void) (x)) 1283 # define assert(x) disabled_assert (x)
1283 # define assert_with_message(x, msg) assert (x) 1284 # define assert_with_message(x, msg) disabled_assert_with_message (x, msg)
1284 # define assert_at_line(x, file, line) assert (x) 1285 # define assert_at_line(x, file, line) disabled_assert_at_line (x, file, line)
1285 #endif 1286 #endif
1286 1287
1287 /************************************************************************/ 1288 /************************************************************************/
1288 /** Memory allocation **/ 1289 /** Memory allocation **/
1289 /************************************************************************/ 1290 /************************************************************************/
4387 EXFUN (Fbyte_code, 3); 4388 EXFUN (Fbyte_code, 3);
4388 4389
4389 DECLARE_DOESNT_RETURN (invalid_byte_code 4390 DECLARE_DOESNT_RETURN (invalid_byte_code
4390 (const CIbyte *reason, Lisp_Object frob)); 4391 (const CIbyte *reason, Lisp_Object frob));
4391 4392
4393 extern Lisp_Object Qbyte_code, Qinvalid_byte_code;
4394
4392 /* Defined in callint.c */ 4395 /* Defined in callint.c */
4393 EXFUN (Fcall_interactively, 3); 4396 EXFUN (Fcall_interactively, 3);
4394 EXFUN (Fprefix_numeric_value, 1); 4397 EXFUN (Fprefix_numeric_value, 1);
4395 4398
4396 /* Defined in casefiddle.c */ 4399 /* Defined in casefiddle.c */
4465 /* Do NOT use word_to_lisp or wasteful_word_to_lisp to decode time_t's 4468 /* Do NOT use word_to_lisp or wasteful_word_to_lisp to decode time_t's
4466 unless you KNOW arg is non-negative. They cannot return negative 4469 unless you KNOW arg is non-negative. They cannot return negative
4467 values! Use make_time. */ 4470 values! Use make_time. */
4468 Lisp_Object word_to_lisp (unsigned int); 4471 Lisp_Object word_to_lisp (unsigned int);
4469 unsigned int lisp_to_word (Lisp_Object); 4472 unsigned int lisp_to_word (Lisp_Object);
4473
4474 extern Lisp_Object Qarrayp, Qbitp, Qchar_or_string_p, Qcharacterp,
4475 Qerror_conditions, Qerror_message, Qinteger_char_or_marker_p,
4476 Qinteger_or_char_p, Qinteger_or_marker_p, Qlambda, Qlistp, Qnatnump,
4477 Qnonnegativep, Qnumber_char_or_marker_p, Qnumberp, Qquote, Qtrue_list_p;
4478 extern MODULE_API Lisp_Object Qintegerp;
4479
4480 extern Lisp_Object Qarith_error, Qbeginning_of_buffer, Qbuffer_read_only,
4481 Qcircular_list, Qcircular_property_list, Qconversion_error,
4482 Qcyclic_variable_indirection, Qdomain_error, Qediting_error,
4483 Qend_of_buffer, Qend_of_file, Qerror, Qfile_error, Qinternal_error,
4484 Qinvalid_change, Qinvalid_constant, Qinvalid_function, Qinvalid_operation,
4485 Qinvalid_read_syntax, Qinvalid_state, Qio_error, Qlist_formation_error,
4486 Qmalformed_list, Qmalformed_property_list, Qno_catch, Qout_of_memory,
4487 Qoverflow_error, Qprinting_unreadable_object, Qquit, Qrange_error,
4488 Qsetting_constant, Qsingularity_error, Qstack_overflow,
4489 Qstructure_formation_error, Qtext_conversion_error, Qunderflow_error,
4490 Qvoid_function, Qvoid_variable, Qwrong_number_of_arguments,
4491 Qwrong_type_argument;
4492 extern MODULE_API Lisp_Object Qinvalid_argument, Qsyntax_error;
4470 4493
4471 /* Defined in dired.c */ 4494 /* Defined in dired.c */
4472 Lisp_Object make_directory_hash_table (const Ibyte *); 4495 Lisp_Object make_directory_hash_table (const Ibyte *);
4473 Lisp_Object wasteful_word_to_lisp (unsigned int); 4496 Lisp_Object wasteful_word_to_lisp (unsigned int);
4474 4497
5927 ;; finally terminate the last line. 5950 ;; finally terminate the last line.
5928 (princ ";\n")))))) 5951 (princ ";\n"))))))
5929 5952
5930 */ 5953 */
5931 5954
5932 extern Lisp_Object Qactivate_menubar_hook, Qand_optional, Qand_rest; 5955 extern Lisp_Object Qactivate_menubar_hook, Qand_optional, Qand_rest, Qautoload,
5933 extern Lisp_Object Qarith_error, Qarrayp, Qautoload, Qbackground; 5956 Qbackground, Qbackground_pixmap, Qblinking, Qbuffer_glyph_p, Qbuffer_live_p,
5934 extern Lisp_Object Qbackground_pixmap, Qbeginning_of_buffer, Qbitp, Qblinking; 5957 Qcall_interactively, Qcategory_designator_p,
5935 extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only; 5958 Qcategory_table_value_p, Qcdr, Qcolor_pixmap_image_instance_p, Qcommandp,
5936 extern Lisp_Object Qbyte_code, Qcall_interactively, Qcategory_designator_p; 5959 Qcompletion_ignore_case, Qconsole_live_p, Qconst_specifier, Qcurrent_menubar,
5937 extern Lisp_Object Qcategory_table_value_p, Qcdr, Qchar_or_string_p; 5960 Qdefun, Qdevice_live_p, Qdim, Qdirection, Qdisabled, Qdisabled_command_hook,
5938 extern Lisp_Object Qcharacterp, Qcircular_list, Qcircular_property_list; 5961 Qdisplay_table, Qdll_error, Qend_open, Qerror_lacks_explanatory_string,
5939 extern Lisp_Object Qcolor_pixmap_image_instance_p, Qcommandp; 5962 Qevent_live_p, Qexit, Qextent_live_p, Qexternal_debugging_output, Qfeaturep,
5940 extern Lisp_Object Qcompletion_ignore_case, Qconsole_live_p, Qconst_specifier; 5963 Qfile_error, Qfile_name_sans_extension, Qfinal, Qforeground, Qformat,
5941 extern Lisp_Object Qconversion_error, Qcurrent_menubar; 5964 Qframe_live_p, Qgraphic, Qgui_error, Qicon_glyph_p, Qidentity, Qinhibit_quit,
5942 extern Lisp_Object Qcyclic_variable_indirection, Qdefun, Qdevice_live_p, Qdim; 5965 Qinhibit_read_only, Qinteractive, Qlayout, Qload, Qlong_name, Qmacro,
5943 extern Lisp_Object Qdirection, Qdisabled, Qdisabled_command_hook; 5966 Qmakunbound, Qmark, Qmodule, Qmono_pixmap_image_instance_p,
5944 extern Lisp_Object Qdisplay_table, Qdll_error, Qdomain_error, Qediting_error; 5967 Qmouse_leave_buffer_hook, Qnative_layout, Qnetwork_error,
5945 extern Lisp_Object Qend_of_buffer, Qend_of_file, Qend_open, Qerror; 5968 Qnothing_image_instance_p, Qpoint, Qpointer_glyph_p,
5946 extern Lisp_Object Qerror_conditions, Qerror_lacks_explanatory_string; 5969 Qpointer_image_instance_p, Qprint_length, Qprint_string_length, Qprogn,
5947 extern Lisp_Object Qerror_message, Qevent_live_p, Qexit, Qextent_live_p; 5970 Qread_char, Qread_from_minibuffer, Qreally_early_error_handler,
5948 extern Lisp_Object Qexternal_debugging_output, Qfeaturep, Qfile_error; 5971 Qregion_beginning, Qregion_end, Qregistries, Qreverse_direction_charset,
5949 extern Lisp_Object Qfile_name_sans_extension, Qfinal; 5972 Qrun_hooks, Qsans_modifiers, Qsave_buffers_kill_emacs, Qself_insert_command,
5950 extern Lisp_Object Qforeground, Qformat, Qframe_live_p, Qgraphic; 5973 Qself_insert_defer_undo, Qsequencep, Qset, Qshort_name, Qsound_error,
5951 extern Lisp_Object Qgui_error, Qicon_glyph_p, Qidentity, Qinhibit_quit; 5974 Qstandard_input, Qstandard_output, Qstart_open, Qstring_lessp, Qsubwindow,
5952 extern Lisp_Object Qinhibit_read_only, Qinteger_char_or_marker_p; 5975 Qsubwindow_image_instance_p, Qtext_image_instance_p, Qtop_level, Qunderline,
5953 extern Lisp_Object Qinteger_or_char_p, Qinteger_or_marker_p; 5976 Quser_files_and_directories, Qvalues, Qvariable_documentation,
5954 extern Lisp_Object Qinteractive, Qinternal_error; 5977 Qvariable_domain, Qwindow_live_p, Qyes_or_no_p;
5955 extern Lisp_Object Qinvalid_byte_code, Qinvalid_change, Qinvalid_constant; 5978
5956 extern Lisp_Object Qinvalid_function, Qinvalid_operation; 5979 extern MODULE_API Lisp_Object Qprocess_error, Qt, Qunbound;
5957 extern Lisp_Object Qinvalid_read_syntax, Qinvalid_state, Qio_error, Qlambda;
5958 extern Lisp_Object Qlayout, Qlist_formation_error, Qlistp, Qload;
5959 extern Lisp_Object Qlong_name, Qmacro, Qmakunbound, Qmalformed_list;
5960 extern Lisp_Object Qmalformed_property_list, Qmark, Qmodule;
5961 extern Lisp_Object Qmono_pixmap_image_instance_p, Qmouse_leave_buffer_hook;
5962 extern Lisp_Object Qnative_layout, Qnatnump, Qnetwork_error, Qno_catch;
5963 extern Lisp_Object Qnonnegativep, Qnothing_image_instance_p;
5964 extern Lisp_Object Qnumber_char_or_marker_p, Qnumberp, Qout_of_memory;
5965 extern Lisp_Object Qoverflow_error, Qpoint, Qpointer_glyph_p;
5966 extern Lisp_Object Qpointer_image_instance_p, Qprint_length;
5967 extern Lisp_Object Qprint_string_length, Qprinting_unreadable_object;
5968 extern Lisp_Object Qprogn, Qquit, Qquote, Qrange_error;
5969 extern Lisp_Object Qread_char, Qread_from_minibuffer;
5970 extern Lisp_Object Qreally_early_error_handler, Qregion_beginning;
5971 extern Lisp_Object Qregion_end, Qregistries, Qreverse_direction_charset;
5972 extern Lisp_Object Qrun_hooks, Qsans_modifiers, Qsave_buffers_kill_emacs;
5973 extern Lisp_Object Qself_insert_command, Qself_insert_defer_undo, Qsequencep;
5974 extern Lisp_Object Qset, Qsetting_constant, Qshort_name, Qsingularity_error;
5975 extern Lisp_Object Qsound_error, Qstack_overflow, Qstandard_input;
5976 extern Lisp_Object Qstandard_output, Qstart_open, Qstring_lessp;
5977 extern Lisp_Object Qstructure_formation_error, Qsubwindow;
5978 extern Lisp_Object Qsubwindow_image_instance_p;
5979 extern Lisp_Object Qtext_conversion_error, Qtext_image_instance_p, Qtop_level;
5980 extern Lisp_Object Qtrue_list_p, Qunderflow_error, Qunderline;
5981 extern Lisp_Object Quser_files_and_directories, Qvalues;
5982 extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvoid_function;
5983 extern Lisp_Object Qvoid_variable, Qwindow_live_p, Qwrong_number_of_arguments;
5984 extern Lisp_Object Qwrong_type_argument, Qyes_or_no_p;
5985
5986 extern MODULE_API Lisp_Object Qintegerp, Qinvalid_argument, Qprocess_error;
5987 extern MODULE_API Lisp_Object Qsyntax_error, Qt, Qunbound;
5988 5980
5989 #define SYMBOL(fou) extern Lisp_Object fou 5981 #define SYMBOL(fou) extern Lisp_Object fou
5990 #define SYMBOL_MODULE_API(fou) extern MODULE_API Lisp_Object fou 5982 #define SYMBOL_MODULE_API(fou) extern MODULE_API Lisp_Object fou
5991 #define SYMBOL_KEYWORD(la_cle_est_fou) extern Lisp_Object la_cle_est_fou 5983 #define SYMBOL_KEYWORD(la_cle_est_fou) extern Lisp_Object la_cle_est_fou
5992 #define SYMBOL_GENERAL(tout_le_monde, est_fou) \ 5984 #define SYMBOL_GENERAL(tout_le_monde, est_fou) \