summaryrefslogtreecommitdiff
path: root/src/unexw32.c
Commit message (Collapse)AuthorAge
* Update copyright year to 2021Paul Eggert2021-01-01
| | | | Run "TZ=UTC0 admin/update-copyright".
* Update copyright year to 2020Paul Eggert2020-01-01
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Clean up memory allocation and unexec support on MS-WindowsEli Zaretskii2019-01-18
| | | | | | | | | | | | | | | | | | | | | * src/w32heap.c (report_temacs_memory_usage): Condition on !CANNOT_DUMP, in addition to ENABLE_CHECKING. (init_heap): Accept an argument, which tells us what heap allocation method to use. (DUMPED_HEAP_SIZE) [CANNOT_DUMP]: Define to a small value, as we don't use dumped_data[] in this case. * src/w32heap.h (init_heap): Adjust prototype. <using_dynamic_heap>: Remove declaration. * src/emacs.c (main) [WINDOWSNT]: Determine heap allocation method based on whether we are in temacs and whether unexec will be used to dump Emacs. Pass the heap allocation method to init_heap, which is now called after parsing the --temacs=METHOD option. * src/unexw32.c (unexec): Don't fiddle with using_dynamic_heap. <using_dynamic_heap>: Remove definition. * src/w32proc.c (malloc_before_init, realloc_before_init) (free_before_init): New functions, to catch memory allocation before heap allocation method is set up.
* Add portable dumperDaniel Colascione2019-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new portable dumper as an alternative to unexec. Use it by default. * src/dmpstruct.awk: New file. * src/doc.c (get_doc_string): use will_dump_p(). * src/editfns.c (styled_format): silence compiler warning with UNINIT. * src/emacs-module.c (syms_of_module): staticpro ltv_mark. * src/emacs.c (gflags): new variable. (init_cmdargs): unwrap (string_starts_with_p, find_argument, dump_error_to_string) (load_pdump): new functions. (main): detect pdumper and --temacs invocation; actually load portable dump when detected; set gflags as appropriate; changes to init functions throughout to avoid passing explicit 'initialized' argument. * src/eval.c (inhibit_lisp_code): remove unused variable. (init_eval_once_for_pdumper): new function. (init_eval_once): call it. * src/filelock.c: CANNOT_DUMP -> will_dump_p() * src/fingerprint-dummy.c: new file * src/fingerprint.h: new file * src/fns.c: CANNOT_DUMP -> will_dump_p(), etc. (weak_hash_tables): remove (hashfn_equal, hashfn_eql): un-staticify (make_hash_table): set new 'next_weak' hash table field; drop global weak_hash_tables logic. (copy_hash_table): drop global weak_hash_tables logic. (hash_table_rehash): new function. (hash_lookup, hash_put, hash_remove_from_table, hash_clear): rehash if needed. (sweep_weak_table): un-staticify; explain logic; bool-ify. (sweep_weak_hash_tables): remove function. * src/font.c (syms_of_font): remember pdumper stuff. * src/fontset.c (syms_of_fontset): remember pdumper stuff. * src/frame.c (make_initial_frame): don't reset Vframe_list. (init_frame_once_for_pdumper, init_frame_once): new functions. (syms_of_frame): remove redundant staticpro. * src/fringe.c (init_fringe_once_for_pdumper): new functin. (init_fringe_once): call it. * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper): new function. (syms_of_ftcrfont): call it. * src/ftfont.c (syms_of_ftfont_for_pdumper): new function. (syms_of_ftfont): call it. * src/ftxont.c (syms_of_ftxfont_for_pdumper): new function. (syms_of_ftxfont): call it. * src/gmalloc.c: adjust for pdumper througout (DUMPED): remove weird custom dumped indicator. * src/gnutls.c (syms_of_gnutls): pdumper note for gnutls_global_initialized. * src/image.c (syms_of_image): add pdumper comment, initializer note. * src/insdel.c (prepare_to_modify_buffer_1): account for buffer contents possibly being in dump image. * src/keyboard.c (syms_of_keyboard_for_pdumper): new function. (syms_of_keyboard): staticpro more; call pdumper syms function. * src/lisp.h: add comments throughout (gflags): declare. (will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p) (dumped_with_pdumper_p, will_dump_with_unexec_p) (dumped_with_unexec_p, definitely_will_not_unexec_p): new functions. (POWER_OF_2, ROUNDUP): move macros. (PSEUDOVECTOR_TYPE, PSEUDOVECTOR_TYPEP): take vectorlike header pointer instead of vector; constify. (Lisp_Hash_Table): add comment about need to rehash on access; add comment for next_weak. (HASH_KEY, HASH_VALUE, HASH_HASH, HASH_TABLE_SIZE): const-ify. (hash_table_rehash): declare. (hash_rehash_needed_p, hash_rehash_if_needed): new functions. (finalizers, doomed_finalizers): declare extern. (SUBR_SECTION_ATTRIBUTE): new macro. (staticvec, staticidx): un-static-ify. (sweep_weak_hash_tables): remove declaration. (sweep_weak_table): declare. (hashfn_eql, hashfn_equal): declare. (number_finalizers_run): new variable. (Vdead): externify when ENABLE_CHECKING. (gc_root_type): new enumeration. (gc_root_visitor): new struct. (visit_static_gc_roots): declare. (vectorlike_nbytes): declare. (vector_nbytes): define as trivial inline function wrapper for vectorlike_nbytes. (init_obarray_once): change signature. (primary_thread): extern-ify. (init_buffer): change signature. (init_frame_once): declare. * src/lread.c (readevalloop): adjust for new dumped predicates. (init_obarray_once): new function. (ndefsubr): new variable. (defsubr): increment it. (load_path_check): adjust for pdumper. (load_path_default): use pdumper functions; adjust for dump search. * src/macfont.m (macfont_init_font_change_handler): avoid shadowing global. (syms_of_macfont_for_pdumper): new function. (syms_of_macfont): call it. * src/menu.c (syms_of_menu): staticpro more stuff. * src/minibuf.c (Ftry_completion): rehash if needed. (init_minibuf_once_for_pdumper): new function. (init_minibuf_once): call it. * src/nsfont.m (syms_of_nsfns): staticpro more. * src/nsfont.m (syms_of_nsfont_for_pdumper): new function. (syms_of_nsfont): call it. * src/nsterm.m (syms_of_nsfont): remember pdumper stuff. * src/pdumper.c: new file. * src/pdumper.h: new file. * src/process.c (init_process_emacs): use new pdumper functions instead of CANNOT_DUMP. * src/profiler.c (syms_of_profiler_for_pdumper): new function. (syms_of_profiler_for_pdumper): call it. * src/search.c (syms_of_search_for_pdumper): new function. (syms_of_search_for_pdumper): call it. * src/sheap.c (bss_sbrk_did_unexec): remove. * src/sheap.h (bss_sbrk_did_unexec): remove. * src/syntax.c (syms_of_syntax): don't redundantly staticpro re_match_object. * src/sysdep.c: use will_dump_with_unexec_p() instead of bss hack thing. * src/syssignals.h (init_sigsegv): declare. * src/systime.h (init_timefns): remove bool from signature. * src/textprop.c (syms_of_textprop): move staticpro. * src/thread.c (main_thread_p): constify. * src/thread.h (main_thread_p): constify. * src/timefns.c (init_timefns): remove bool from signature. (syms_of_timefns_for_pdumper): new function. (syms_of_timefns): call it. * src/w32.c: rearrange code. * src/w32.h (w32_relocate): declare. * src/w32fns.c (syms_of_w32fns): add pdumper note. * src/w32font.c (syms_of_w32font_for_pdumper): new function. (syms_of_w32font): call it. * src/w32heap.c (using_dynamic_heap): new variable. (init_heap): use it. * src/w32menu.c (syms_of_w32menu): add pdumper note. * src/w32proc.c (ctrl_c_handler, mainCRTStartup, _start, open_input_file) (rva_to_section, close_file_data): move here. * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper): new function. (syms_of_w32uniscribe): call it. * src/window.c (init_window_once_for_pdumper): new function. (init_window_once): call it; staticpro more stuff. * src/xfont.c (syms_of_xfont_for_pdumper): new function. (syms_of_xfont): call it. * src/xftfont.c (syms_of_xftfont_for_pdumper): new function. (syms_of_xftfont): call it. * src/xmenu.c (syms_of_xmenu_for_pdumper): new function. (syms_of_xmenu): call it. * src/xselect.c (syms_of_xselect_for_pdumper): new function. (syms_of_xselect): call it. * src/xsettings.c (syms_of_xsettings): add more pdumper notes. * src/term.c (syms_of_xterm): add pdumper note. * src/dispnew.c (init_faces_initial): new function. (init_display_interactive): rename from init_display; use will_dump_p instead of !initialized. Initialize faces early for pdumper if needed. (init_display): new function. (syms_of_display_for_pdumper): new function. (syms_of_display): call it. * src/dbusbind.c (syms_of_dbusbind): Add TODO for bus reset on pdumper load. * src/data.c (Fdefalias): Use will_dump_p instead of Vpurify_flag. (Fmake_variable_buffer_local): silence compiler warning with -Og by making valcontents UNINIT. (arith_driver): silence compiler warning with UNINIT. * src/conf_post.h (ATTRIBUTE_SECTION): new macro. * src/composite.c (composition_gstring_put_cache): rehash hash table if needed. * src/coding.c (init_coding_once, syms_of_coding): remember pdumper stuff. * src/charset.h (charset_table_size, charset_table_user): declare. * src/charset.c (charset_table_used, charset_table_size): un-static. (init_charset_oncem, syms_of_charset): remember pdumper stuff. * src/category.c (category_table_version): remove obsolete variable. * src/callint.c (syms_of_callint): staticpro 'preserved_fns' (init_callproc): use will_dump_p instead of !CANNOT_DUMP. * src/bytecode.c (exec_byte_code): rehash table tables if needed * src/buffer.c (alloc_buffer_text, free_buffer_text): account for pdumper (init_buffer_once): add TODO; remember stuff for pdumper. (init_buffer): don't take initialized argument; adjust for pdumper. * src/atimer.c (init_atimer): initialize subr only if !initialized. * src/alloc.c: (vector_marked_p, set_vector_marked) (vectorlike_marked_p, set_vectorlike_marked, cons_marked_p) (set_cons_marked, string_marked_p, set_string_marked) (symbol_marked_p, set_symbol_marked, interval_marked_p) (set_interval_marked): new accessor routines. Use them instead of raw GC access throughout. (Vdead): make non-static when ENABLE_CHECKING. (vectorlike_nbytes): rename of 'vector_nbytes'; take a vectorlike header as input instead of a vector. (number_finalizers_run): new internal C variable. (mark_maybe_object): check for pdumper objects. (valid_pointer_p): don't be gratuitously inefficient under rr(1). (make_pure_c_string): add support for size_byte = -2 mode indicating that string data points into Emacs image rodata. (visit_vectorlike_root): visits GC roots embedded in vectorlike objects. (visit_buffer_root): visits GC roots embedded in our totally-not-a-buffer buffer global objects. (visit_static_gc_roots): visit GC roots in the Emacs data section. (mark_object_root_visitor): root callback used for conventional GC marking (weak_hash_tables): new internal variable for tracking found weak hash tables during GC. (mark_and_sweep_weak_table_contents): new weak hash table marking. (garbage_collect_1): use new GC root visitor machinery. (mark_vectorlike): accept a vectorlike_header instead of a Lisp_Vector. (mark_frame, mark_window, mark_hash_table): new functions. (mark_object): initialize 'm'; check for pdumper objects and use new mark-bit accessors throughout. Remove some object-specific marking code and move to helper functions above. (survives_gc_p): check for pdumper objects. (gc-sweep): clear pdumper mark bits. (init_alloc_once_for_pdumper): new helper function for early init called both during normal init and pdumper load. (init_alloc_once): pdumper integration. * src/Makefile.in: Rewrite dumping for pdumper; add pdumper.o; invoke temacs with --temacs command line option; build dmpstruct.h from dmpstruct.awk; stop relying on CANNOT_DUMP; clean up pdumper intermediate files during build. * nextstep/Makefile.in: build emacs.pdmp into NS packages * lisp/startup.el: account for new '--temacs' and '--dump-file' command line option. * lisp/loadup.el: rewrite early init to account for pdumper; use injected 'dump-mode' variable (set via the new '--temacs' option) instead of parsing command line. * lisp/cus-start.el: Check 'dump-mode' instead of 'purify-flag', since the new 'dump-mode' * lib-src/make-fingerprint.c: new program * lib-src/Makefile.in: built make-fingerprint utility program * configure.ac: Add --with-pdumper toggle to control pdumper support; add --with-unexec toggle to control unexec support. Add --with-dumping option to control which dumping strategy we use by default. Adjust for pdumper throughout. Check for posix_madvise. * Makefile.in: Add @DUMPING@ substitution; add pdumper mode. * .gitignore: Add make-fingerprint, temacs.in, fingerprint.c, dmpstruct.h, and pdumper dump files.
* Update copyright year to 2019Paul Eggert2019-01-01
| | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* Update copyright year to 2018Paul Eggert2018-01-01
| | | | Run admin/update-copyright.
* Avoid MinGW64 compiler warnings in unexw32.cAndy Moreton2017-09-16
| | | | | * src/unexw32.c (pDWP) [MINGW_W64]: Define to "16llx" only for the 64-bit build.
* Avoid compilation warnings with GCC 7 on MS-WindowsEli Zaretskii2017-09-15
| | | | | | | | | | | | * src/w32term.c (w32_setup_relief_color, construct_mouse_click) (w32_read_socket): Initialize variables to shut up bogus compilation warnings from GCC 7. * src/unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Cast to DWORD_PTR to avoid compiler warnings about printing signed values using %x format spec. * src/dispnew.c (adjust_glyph_matrix): Add eassert to avoid compiler warning about possible NULL pointer dereference. * src/lisp.h (pI): Tweak the definition some more for MinGW64.
* Avoid 64-bit compilation warnings in unexw32.cEli Zaretskii2017-09-14
| | | | | | * src/unexw32.c (pDWP): New macro. (COPY_CHUNK, COPY_PROC_CHUNK): Declare 'count' as DWORD_PTR. Use pDWP for printing values that can be either 32-bit or 64-bit wide.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-13
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Fix compilation warnings in MinGW64 build using GCC 7Eli Zaretskii2017-09-09
| | | | | | | | | | | | | | | | | | | | | | | Reported by Richard Copley <rcopley@gmail.com>. * src/w32heap.c (init_heap): Declare enable_lfh only for mingw.org's MinGW build. * src/w32console.c (w32con_write_glyphs): * src/unexw32.c (get_section_info, COPY_CHUNK, unexec): Fix some mismatches of data type vs format spec. * src/w32fns.c (compute_tip_xy): * src/w32proc.c (stop_timer_thread): * src/w32notify.c (remove_watch): * src/eval.c (internal_lisp_condition_case): * src/editfns.c (Ftranslate_region_internal): * src/data.c (Fmake_variable_buffer_local, cons_to_unsigned) (cons_to_signed): * src/buffer.c (fix_overlays_before): Initialize variables to avoid compiler warnings. * lib-src/etags.c (TeX_commands, process_file_name): Initialize variables to avoid compilation warnings.
* Merge from origin/emacs-25Paul Eggert2017-01-01
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-31
| | | | | | | | Run admin/update-copyright.
* | Fix crashes on MS-Windows during dumpingEli Zaretskii2016-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/unexw32.c (get_section_info): Make extra_bss_size be the maximum of extra_bss_size and extra_bss_size_static. This avoids computing the size of the output file smaller than it actually needs to be, which then causes copy_executable_and_dump_data to write beyond the requested size of the file mapping, thus relying on the OS roundup to page boundary to save us from ourselves. See http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html for the details. * lib/stdio-impl.h: Revert the workaround fix of not including errno.h for MinGW.
* | Fix compiler warnings in the MinGW buildEli Zaretskii2016-05-21
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac [mingw32]: Don't add -Wpointer-sign, and add -Wno-pointer-sign, to keep the noise level down. * nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable -Wredundant-decls, as that produces a lot of noise due to redeclaration of time-related functions by gnulib. * nt/runemacs.c (set_user_model_id): Fix argument type of 'SetCurrentProcessExplicitAppUserModelID'. * src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't declare 'dpyinfo', as it is unused. (xpm_load): Fix warnings about pointer signedness. * src/w32proc.c (IsValidLocale, init_winsock): Remove redundant prototypes. (sys_spawnve): Avoid warnings about discarding 'const' qualifier. (sys_select): Provide prototype. (g_b_init_compare_string_w): Move declaration to file scope. * src/w32heap.c (dumped_data_commit): Now static. (FREEABLE_P): Avoid warnings about pointer comparison with integer. (mmap_realloc): Cast to 'char *' for arithmetics on void pointers. * src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr) (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear): Provide prototypes. * src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove redundant prototypes. (w32_get_internal_run_time, map_w32_filename): Provide prototype. (init_environment, sys_ctime): Avoid warnings about discarding 'const' qualifier. Include utimens.h. (sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir) (sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock) (sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide prototypes. (sys_rename_replace): Use %d to avoid compiler warnings. (_wsa_errlist): Make the message text 'const char *', to avoid compilation warnings. (dynlib_reset_last_error): Move prototype to file scope. (w32_get_resource): First argument is now 'const char *'. * src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype. (otf_features): Second argument is no 'const char *'. * src/w32term.c (free_frame_menubar, x_wm_set_size_hint) (x_set_window_size): Remove redundant prototypes. (XChangeGC, XGetGCValues, w32_draw_underwave) (w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave) (x_calc_absolute_position, x_destroy_window): Now static. (menubar_selection_callback): Move prototype to file scope. * src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant declaration. (w32_to_x_charset): Fix warnings about discarding 'const' qualifier. (w32font_full_name): Fix warnings about implicit conversion of 'float' to 'double'. * src/w32reg.c (w32_get_rdb_resource): Fix warnings about discarding 'const' qualifier. * src/w32menu.c (syms_of_w32menu, globals_of_w32menu) (set_frame_menubar): Remove redundant prototypes. (menubar_selection_callback, w32_menu_display_help): Provide prototypes. (simple_dialog_show): Avoid warnings about discarding 'const' qualifier. * src/w32fns.c (syms_of_w32fns, globals_of_w32fns) (free_frame_menubar, w32_strerror, x_set_menu_bar_lines) (x_set_tool_bar_lines, x_set_internal_border_width): Remove redundant prototypes. (current_popup_menu): Remove redundant declaration. (colormap_t): Member 'name' is now 'const char *'. (add_system_logical_colors_to_map): Fix signed/unsigned warnings. (x_decode_color, x_set_border_pixel) (x_clear_under_internal_border, x_set_name, hook_w32_key) (reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now static. (w32_load_cursor, w32_key_to_modifier, map_keypad_keys) (w32_msg_worker, w32_last_error): Provide prototypes. (funhook, lookup_vk_code): Avoid warnings about missing parentheses. (x_default_font_parameter, Fw32_notification_notify): Avoid warnings about discarding 'const' qualifier. (Fx_create_frame): Avoid warnings about empty body of 'else'. (x_screen_planes): Ifdef away unused function. (Fx_show_tip): Remove unused variables. (Fw32_battery_status): Avoid warnings about implicit promotion from float to double. (Fw32_notification_notify): Initialize 'timeout'. * src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only define the TIMER_SETTIME_RUNNING value if it will be used. * src/w32notify.c (send_notifications): Ifdef away an empty if clause. Remove unused variable. (watch_end, watch_completion): Provide prototypes. * src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused. * src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix warning with pointer signedness. * src/gnutls.c (gnutls_x509_crt_get_signature) (gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and don't load them from the GnuTLS library, as they are no longer used. * src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't define, as it's unused. * src/unexw32.c (open_input_file, open_output_file) (close_file_data): Remove redundant prototypes. (_start): provide prototype. (mainCRTStartup): Move prototype to file level. (find_section): Use type-cast to shut up compiler warnings. (offset_to_section, relocate_offset): Now static. (find_section): First argument is now a 'const char *'. (offset_to_section): Ifdef away, as it's unused. * src/w32heap.h (find_section): Adjust prototype. * src/dynlib.c (dynlib_reset_last_error): Provide prototype. * src/dired.c (directory_files_internal_w32_unwind): Avoid warnings about missing prototypes. (is_slow_fs) [WINDOWSNT]: Provide prototype at file level. (directory_files_internal) [WINDOWSNT]: Fix warnings about pointer signedness. * src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]: Fix warnings about pointer signedness. * src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's unused. * src/sysdep.c (_getpid): Remove redundant prototype. (sys_subshell) [DOS_NT]: Don't define 'status', it's unused. [!MSDOS]: Don't define 'st', it's unused. (init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused. (str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness. * src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define n_to_read, as it is not used. (MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused. * src/w32font.h (syms_of_w32font): Remove redundant prototype. * src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro. * src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are not used by DOS_NT builds, to avoid compiler warnings. * src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant declaration. * src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut up compiler warnings. * src/w32term.h (x_set_window_size, x_get_focus_frame) (x_make_frame_visible, x_make_frame_invisible, x_iconify_frame) (x_set_frame_alpha, x_activate_menubar, x_bitmap_icon) (x_free_frame_resources, x_real_positions) (display_x_get_resource): Remove redundant prototypes. * lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp) (sys_rename, gettimeofday): Provide prototypes. * lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant declarations. * lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'. (xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname) (close_winsock, initialize_sockets, w32_set_user_model_id) (w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add prototypes. (w32_get_resource) [WINDOWSNT]: Fix a warning about signedness difference. (w32_set_user_model_id): Update prototype of SetCurrentProcessExplicitAppUserModelID to avoid compiler warnings. (start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to shut up compiler warnings. * lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
* Rework C source files to avoid ^(Paul Eggert2016-03-10
| | | | | | | | Work around Bug#22884 by rewording comments and strings to avoid ‘(’ at the start of a line unless it starts a function. This change is a short-term hack; in the longer run we plan to fix cc-mode’s performance for C files that have ‘(’ at the start of a line in a comment or string.
* Update copyright year to 2016Paul Eggert2016-01-01
| | | | Run admin/update-copyright.
* Update copyright year to 2015Paul Eggert2015-01-01
| | | | Run admin/update-copyright.
* Consistently use min and max macros from lisp.h.Dmitry Antipov2014-10-03
| | | | | | | | | | * coding.c (min, max): * font.c (MAX): * unexhp9k800.c (min): * unexw32.c (min, max): Use definitions from lisp.h. * regex.c (MAX, MIN) [!emacs]: Define own max and min as such. Adjust users. * gmalloc.c (min): Tiny style change.
* Clean up extern decls a bit.Paul Eggert2014-08-31
| | | | | | | | | | | | | | | | | * configure.ac (WERROR_CFLAGS): Don't disable -Wnested-externs. While we're at it, don't disable -Wlogical-op either. * src/bytecode.c: Include blockinput.h and keyboard.h rather than rolling their APIs by hand. * src/emacs.c: Include regex.h and rely on its and lisp.h's API rather than rolling them by hand. * src/lastfile.c: Include lisp.h, to check this file's API. * src/lisp.h (lisp_eval_depth, my_edata, my_endbss, my_endbss_static): New decls. * src/regex.h (re_max_failures): New decl. * src/unexcw.c, src/unexmacosx.c, src/unexw32.c: Rely on lisp.h's API rather than rolling it by hand. * src/vm-limit.c (__after_morecore_hook, __morecore, real_morecore): Declare at top level, to pacify GCC -Wnested-externs.
* Add diagnostics for using private heap on MS-Windows during dumping.Eli Zaretskii2014-05-29
| | | | | | src/w32heap.c (report_temacs_memory_usage): New function. src/unexw32.c (unexec) [ENABLE_CHECKING]: Call report_temacs_memory_usage. src/w32heap.h (report_temacs_memory_usage): Add prototype.
* Use mmap(2) emulation for buffer text on MS-Windows.Fabrice Popineau2014-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/Makefile.in (C_HEAP_SWITCH): Get the predefined heap size from configure. (ADDSECTION, MINGW_TEMACS_POST_LINK): Remove, no longer used. src/lisp.h (NONPOINTER_BITS): Modify the condition to define to zero for MinGW, since it no longer uses gmalloc. src/buffer.c: Do not define mmap allocations functions for Windows. Remove mmap_find which is unused. Remove mmap_set_vars which does nothing useful. [WINDOWSNT]: Include w32heap.h. (init_buffer): Always allocate new memory for buffers. src/emacs.c: Remove mmap_set_vars calls. src/image.c (free_image): Undef free for Windows because it is redirected to our private version. src/unexw32.c (COPY_PROC_CHUNK): Use %p format for 64bits compatibility. (copy_executable_and_dump_data): Remove dumping the heap section. (unexec): Restore using_dynamic_heap after dumping. src/w32heap.c (dumped_data_commit, malloc_after_dump) (malloc_before_dump, realloc_after_dump, realloc_before_dump) (free_after_dump, free_before_dump, mmap_alloc, mmap_realloc) (mmap_free): New functions. src/w32heap.h: Declare dumped_data and mmap_* function prototypes. nt/inc/ms-w32.h: Switch to the system heap allocation scheme instead of GNU malloc and ralloc. nt/inc/sys/mman.h: New file. nt/INSTALL: Update for the new build requirements. etc/NEWS: Mention build changes on MS-Windows. configure.ac (C_HEAP_SWITCH) define for different values of dumped heap size depending on 32/64bits arch on Windows. Don't check for pthreads.h on MinGW32/64, it gets in the way. Use mmap(2) for buffers and system malloc for MinGW32/64.
* Fix minor build problems related to MinGW64.Fabrice Popineau2014-01-11
| | | | | | | | | configure.ac: Read $srcdir/nt/mingw-cfg.site when $MSYSTEM is "MINGW64" as well. nt/inc/ms-w32.h (pthread_sigmask): Undefine if defined, for MinGW64. src/unexw32.c (_start) [__MINGW64__]: Define to __start.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-01
|
* Converted spawnve, but not tested the result yet.Eli Zaretskii2013-12-06
|
* Adapted dostounix_filename. w32-short/long-filename work with wide APIs.Eli Zaretskii2013-11-02
|
* Delete previous emacs.exe before dumping to fix problem with hard links to it.Eli Zaretskii2013-04-16
|
* Avoid encoding file names run through dostounix_filename on MS-Windows.Eli Zaretskii2013-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/w32.c (normalize_filename): Accept an additional argument MULTIBYTE; if non-zero, traverse the file name by bytes and don't downcase it even if w32-downcase-file-names is non-nil. (dostounix_filename): Accept an additional argument MULTIBYTE and pass it to normalize_filename. (emacs_root_dir): Adjust. src/msdos.h (dostounix_filename): Adjust prototype. src/w32.h (dostounix_filename): Adjust prototype. src/msdos.c (dostounix_filename): Accept an additional argument and ignore it. (init_environment): Adjust callers of dostounix_filename. src/fileio.c (Ffile_name_directory, file_name_as_directory) (directory_file_name, Fexpand_file_name) (Fsubstitute_in_file_name): [DOS_NT] Adjust call to dostounix_filename. [WINDOWSNT]: Downcase file names if w32-downcase-file-names is non-nil. (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment variables, as egetenv is case-insensitive for DOS_NT. src/dired.c (file_name_completion): Don't call Fdirectory_file_name with an encoded file name. src/w32proc.c (Fw32_short_file_name, Fw32_long_file_name): Adjust calls to dostounix_filename. src/w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename. src/unexw32.c (unexec): Adjust call to dostounix_filename. src/termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename. src/emacs.c (decode_env_path) [DOS_NT]: Adjust call to dostounix_filename. src/callproc.c (Fcall_process) [MSDOS]: Adjust call to dostounix_filename.
* Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.caPaul Eggert2013-01-02
|\
| * Update copyright notices for 2013.Paul Eggert2013-01-01
| |
| * Move fix for bug#12993 to trunkDaniel Colascione2012-12-10
|/
* Compile Windows resources into cygw32 EmacsDaniel Colascione2012-12-09
|
* Fix warnings when compiling on MS-Windows with -std=gnu99.Eli Zaretskii2012-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/makefile.w32-in ($(BLD)/w32.$(O)): ($(BLD)/vm-limit.$(O)): ($(BLD)/term.$(O)): ($(BLD)/unexw32.$(O)): ($(BLD)/fileio.$(O)): ($(BLD)/dispnew.$(O)): Update dependencies. src/w32term.h (w32_initialize_display_info, initialize_w32_display): Add prototypes. src/w32proc.c: Include ctype.h. src/w32.h (init_environment, check_windows_init_file) (syms_of_ntproc, syms_of_ntterm, dostounix_filename) (unixtodos_filename, init_winsock, srandom, random, sys_pipe) (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd) (sys_link): Add prototypes. src/w32.c: Include w32select.h. (sys_access, e_malloc, sys_select): Add prototypes. (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval. src/vm-limit.c [WINDOWSNT]: Include w32heap.h. src/unexw32.c: Include lisp.h and w32.h. src/term.c [WINDOWSNT]: Include w32term.h. src/process.c [WINDOWSNT]: Add prototype of sys_select. src/fileio.c [WINDOWSNT]: Include w32.h. src/dispnew.c [WINDOWSNT]: Include w32.h. nt/inc/pwd.h (getuid, geteuid): Add prototypes. nt/inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r) (signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask) (pthread_sigmask, sigismember, setpgrp, sigaction, alarm) (sys_kill, getpagesize): Add prototypes for emulated functions. nt/inc/grp.h (getgid, getegid): Add prototypes. nt/gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99. nt/configure.bat (chkapiN): Avoid compiler warning in junk.c when compiling with -std=gnu99. nt/config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it could be used via --cflags switch to configure.bat.
* Code cleanup for cygw32Daniel Colascione2012-10-08
|
* Merge from trunkDaniel Colascione2012-10-07
|\
| * Clean up the Windows x64 changes.Eli Zaretskii2012-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nt/preprep.c (RVA_TO_PTR): Use 'unsigned char *' instead of 'void *', for pointer arithmetics. (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET): Enclose all macro arguments in parentheses. src/unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET) (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses. (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *', as the previous version used 'void *'. src/ralloc.c (ROUNDUP): Fix last change. (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type 'size_t'. Fixes: debbugs:12544
| * Support x64 build on MS-Windows with MSVC.Fabrice Popineau2012-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64. (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for compatibility with x64. src/w32term.c (w32_draw_underwave): Don't use GCC extensions for defining an XRectangle structure. src/w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer arithmetics for compatibility with x64. src/w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for compatibility with x64. src/w32heap.h: Adjust prototypes and declarations. src/w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap) (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of DWORD, long, and unsigned long, for compatibility with x64. (allocate_heap) [_WIN64]: Reserve 32GB of memory. (sbrk): Argument is now of type ptrdiff_t. src/w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being less than 0x0500. (w32_msg_pump): Use WPARAM type for 'result'. src/w32.c (init_environment, get_emacs_configuration): Support AMD64 architecture. (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for compatibility with x64. src/vm-limit.c (lim_data): Now size_t. (check_memory_limits): Adjust prototypes of real_morecore and __morecore to receive argument of type ptrdiff_t. Use size_t for five_percent and data_size. src/unexw32.c: Use DWORD_PTR instead of DWORD for file-scope variables, for compatibility with x64. (rva_to_section, offset_to_section, relocate_offset) (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET) (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info) (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD for compatibility with x64. src/sysdep.c (STDERR_FILENO): Define if not already defined. src/ralloc.c (real_morecore): Argument type is now ptrdiff_t. (__morecore): Argument type is now ptrdiff_t. (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'. (relinquish): Use ptrdiff_t type for 'excess'. (r_alloc_sbrk): Argument type is now ptrdiff_t. src/makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE. (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE) instead of a literal number. src/gmalloc.c [WINDOWSNT]: Include w32heap.h. (min): Define only if not already defined. src/frame.c (x_report_frame_params): Use EMACS_UINT for the return value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows hosts. src/image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since 'bitmaps' is a pointer. src/dispextern.h (x_bitmap_pixmap): Adjust prototype. src/alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__. nt/makefile.w32-in ($(TRES)): Use $(EMACS_MANIFEST). nt/inc/sys/socket.h: Don't map Winsock error codes to standard ones that are already defined. nt/inc/ms-w32.h (EMACS_INT, EMACS_UINT, EMACS_INT_MAX, PRIuMAX) (pI, _INTPTR) [_MSC_VER]: Fix definitions for MSVC. [_MSC_VER]: Add pragmas to suppress some MSVC warnings. nt/preprep.c (pfnCheckSumMappedFile, rva_to_section) (offset_to_section, relocate_offset, OFFSET_TO_RVA) (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA) (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN) (copy_executable_and_move_sections, ADJUST_IMPORT_RVA, main): Use DWORD_PTR instead of DWORD for compatibility with x64. nt/nmake.defs: Support AMD64. (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST): New macros. nt/gmake.defs: (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST): New macros. nt/addsection.c (pfnCheckSumMappedFile, rva_to_section) (offset_to_section, relocate_offset, OFFSET_TO_RVA) (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA) (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN) (copy_executable_and_add_section, main): Use DWORD_PTR instead of DWORD, for compatibility with x64. nt/emacs-x64.manifest: New file. nt/emacs-x86.manifest: Renamed from emacs.manifest. lib-src/ntlib.c (gettimeofday): Copy from src/w32.c. lib/gettime. needs this function.
* | Implement cygw32Daniel Colascione2012-09-17
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Here, we use the generic window-system configuration system we just implemented to support the w32 window-system in the mainline build under Cygwin. (Previously, the w32 window system could only be compiled as part of the NT-native Emacs build process.) The changes in this patch need to be applied atomically in order to avoid breaking Emacs. The changes include: - Changes throughout the Lisp and C code to not assume that NT Emacs and the w32 window system are synonymous. - Wiring up the regular select(2) event loop to Windows messages - Cleaning up the w32 drag-and-drop receiving code. - Exposing Cygwin path conversion functions to elisp. - Unicode file dialog support when compiling for Cygwin. - Splitting the w32 term lisp initialization code into code applicable to any w32 window-system and code specific to system-type windows-nt. - Integrating the old and new w32 code into the build system.
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-05
|
* Whitespace changes.Juanma Barranquero2011-09-09
|
* nt/*.c, src/*.c: Remove unused variables.Juanma Barranquero2011-03-25
| | | | | | | | | | | | | | | | | | | | | | | | * nt/addpm.c (main): Remove unused variable `retval'. * nt/preprep.c (main): Remove unused variable `ptr'. * src/dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef. * src/fileio.c (check_executable) [DOS_NT]: Remove unused variables `len' and `suffix'. (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration of variables specific to SELinux and computation of `encoded_absname'. * src/image.c (XPutPixel): Remove unused variable `height'. * src/keyboard.c (make_lispy_event): Remove unused variable `hpos'. * src/unexw32.c (get_section_info): Remove unused variable `section'. * src/w32.c (stat): Remove unused variables `drive_root' and `devtype'. (system_process_attributes): Remove unused variable `sess'. (sys_read): Remove unused variable `err'. * src/w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef. (w32_wnd_proc): Remove unused variable `isdead'. (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef. (Fx_server_max_request_size): Remove unused variable `dpyinfo'. (x_create_tip_frame): Remove unused variable `tem'. * src/w32inevt.c (w32_console_read_socket): Remove unused variable `no_events'. * src/w32term.c (x_draw_composite_glyph_string_foreground): Remove unused variable `width'.
* Change unexec implementations to match prototype.Paul Eggert2011-03-17
|
* New file unexec.h, the (simple) interface for unexec.Paul Eggert2011-03-16
| | | | | | | | | * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o): (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o): Depend on unexec.h. * emacs.c [!defined CANNOT_DUMP]: Include unexec.h. * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c: * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-24
|
* Nuke arch-tags.Glenn Morris2011-01-15
|
* Merge from emacs-23Stefan Monnier2011-01-14
|\
| * Add 2011 to FSF/AIST copyright years.Glenn Morris2011-01-02
| |
* | Remove unused arguments for unexec.Dan Nicolaescu2010-10-03
|/ | | | | | | | | | | | | | | | | | | | | | | The third one is never used, and the last two are always passed as zero. * src/emacs.c (unexec): Add declaration. (Fdump_emacs): Only pass the first two arguments to unexec. Simplify #ifdef. * src/unexw32.c (unexec): * src/unexsol.c (unexec): * src/unexhp9k800.c (unexec): * src/unexcw.c (unexec): Remove the last 3 arguments, unused. * src/unexelf.c (unexec): Remove the last 3 arguments, unused. (find_section): Use const. * src/unexmacosx.c (unexec): Remove the last 3 arguments, unused. (unexec_error): Declare it NO_RETURN. * src/unexcoff.c (make_hdr): Assume bss_start is always zero, remove it as an argument, remove data_start and entry_address arguments, unused. (unexec): Remove bss_start, data_start and entry_address arguments. * src/unexaix.c (make_hdr): Assume bss_start is always zero, remove it as an argument, remove data_start and entry_address arguments, unused. (unexec): Remove bss_start, data_start and entry_address arguments.
* Add 2010 to copyright years.Glenn Morris2010-01-13
|
* Add 2009 to copyright years.Glenn Morris2009-01-08
|