2014-01-10 07:10:37 +00:00
|
|
|
/* Replacement inttypes.h file for building GNU Emacs on MS-DOS with DJGPP.
|
2011-04-30 10:31:17 +00:00
|
|
|
|
2024-01-02 01:47:10 +00:00
|
|
|
Copyright (C) 2011-2024 Free Software Foundation, Inc.
|
2011-04-30 10:31:17 +00:00
|
|
|
|
|
|
|
This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2016-03-10 15:34:52 +00:00
|
|
|
the Free Software Foundation, either version 3 of the License, or (at
|
|
|
|
your option) any later version.
|
2011-04-30 10:31:17 +00:00
|
|
|
|
|
|
|
GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2017-09-30 00:44:23 +00:00
|
|
|
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
2011-04-30 10:31:17 +00:00
|
|
|
|
|
|
|
#ifndef _REPL_INTTYPES_H
|
|
|
|
#define _REPL_INTTYPES_H
|
|
|
|
|
2011-05-07 10:24:55 +00:00
|
|
|
/* As of May 2011, DJGPP v2.04 does not include stdint.h in its
|
|
|
|
inttypes.h, although it should. Therefore, include stdint.h
|
|
|
|
unconditionally. */
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2011-04-30 10:31:17 +00:00
|
|
|
#if __DJGPP__ > 2 || __DJGPP_MINOR__ >= 4
|
|
|
|
#include_next <inttypes.h>
|
|
|
|
#else /* __DJGPP__ < 2.04 */
|
|
|
|
#include <stdlib.h>
|
|
|
|
#define strtoumax strtoull
|
Fix the MSDOS build.
msdos/mainmake.v2 (boot): Condition the value on the existence of
autogen/README, not admin/admin.el, since the latter is now part
of the release tarball.
(install): Don't copy lib-src/fns.el, as that file is no longer
generated in that directory.
msdos/sed1v2.inp (LIB_PTHREAD, LIB_PTHREAD_SIGMASK): Edit to empty.
(SETTINGS_CFLAGS, SETTINGS_LIBS): Edit these instead of
GCONF_CFLAGS and GCONF_LIBS.
msdos/sedlibmk.inp (ALLOCA_H, AR, ARFLAGS, GNULIB_CHDIR, GNULIB_DUP)
(GNULIB_FDATASYNC, GNULIB_FDOPEN, GNULIB_FSTAT, GNULIB_PCLOSE)
(GNULIB_PTHREAD_SIGMASK, GNULIB_RAISE, GNULIB_SIGACTION)
(GNULIB_SIGPROCMASK, GNULIB_SIGNAL_H_SIGPIPE, HAVE_FDATASYNC)
(HAVE_PCLOSE, HAVE_POPEN, HAVE_POSIX_SIGNALBLOCKING)
(HAVE_PTHREAD_SIGMASK, HAVE_RAISE, HAVE_SIGACTION)
(HAVE_SIGHANDLER_T, HAVE_SIGINFO_T, HAVE_SIGSET_T)
(HAVE_STRUCT_SIGACTION_SA_SIGACTION)
(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T, LIB_PTHREAD)
(LIB_PTHREAD_SIGMASK, NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H)
(NEXT_SIGNAL_H, REPLACE_FDOPEN, REPLACE_PTHREAD_SIGMASK)
(REPLACE_RAISE): New edits.
(gl_LIBOBJS): Remove md5.o, filemode.o, and sha1.o. Add
pthread_sigmask.o.
(@GL_GENERATE_ALLOCA_H_TRUE@, @GL_GENERATE_ALLOCA_H_FALSE@): Edit
to comment out unneeded lines.
(warn-on-use.h): Edit the recipe commands to work with DJGPP
without requiring a Unixy shell.
msdos/inttypes.h (strtoimax) [DJGPP < 2.04]: New macro.
msdos/sed2v2.inp (HAVE_ALLOCA, HAVE_DECL_STRTOLL, HAVE_DECL_STRTOIMAX)
(HAVE_STRTOLL, HAVE_SIGSET_T, HAVE_SNPRINTF): New edits.
.bzrignore: Add ./GNUMakefile.unix.
config.bat: Rename GNUMakefile, so it is not run on MS-DOS.
Rename signal.in.h and alloca.in.h.
src/sysdep.c (snprintf) [EOVERFLOW]: If EOVERFLOW is not defined,
use EDOM.
2011-09-29 12:00:18 +00:00
|
|
|
#define strtoimax strtoll
|
Adapt the MS-DOS build to the latest changes.
msdos/mainmake.v2 (bootstrap-clean): Do a maintainer-clean in lib, not
bootstrap-clean (which doesn't exist).
msdos/inttypes.h (PRIuMAX) [__DJGPP__ < 2.04]: Define to "llu".
msdos/sedleim.inp (MKDIR_P): Edit to DOS "md" command.
msdos/sed1v2.inp: (LIB_CLOCK_GETTIME): Edit to empty.
Remove lines that invoke PAXCTL.
(clean): Fix recipe not to run Unixy shell commands.
msdos/sed2v2.inp (GETTIMEOFDAY_TIMEZONE): Edit to 'struct timezone'.
(HAVE_STRNCASECMP): Edit to 1.
msdos/sed3v2.inp (LIB_CLOCK_GETTIME): Edit to empty.
(C_SWITCH_SYSTEM): Add "-I../msdos".
msdos/sedlibmk.inp (GNULIB_GETTIMEOFDAY, GNULIB_PSELECT)
(GNULIB_SELECT, HAVE_STRUCT_TIMEVAL, HAVE_SYS_SELECT_H)
(HAVE_SYS_TIME_H, NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H)
(NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H, NEXT_SYS_SELECT_H)
(NEXT_SYS_TIME_H, REPLACE_GETTIMEOFDAY, REPLACE_PSELECT)
(REPLACE_STRUCT_TIMEVAL): Edit to appropriate values.
(BUILT_SOURCES): Edit out sys/select.h and sys/time.h.
(mostlyclean-local, distclean-generic): Fix recipe not to run
Unixy shell commands.
src/sysselect.h [DOS_NT]: Don't include sys/select.h.
src/s/ms-w32.h (select, pselect): Don't define here, they are
defined in sysselect.h
src/sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select.
src/sysdep.c: Don't include dos.h and dosfns.h.
src/process.c (sys_select):
src/msdos.c (sys_select): Accept one more argument and ignore it.
src/msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
adapt data types and code to that.
src/dosfns.c:
src/msdos.c (gettime, settime): Define away the prototypes in dos.h,
which clashes with the gnulib function of the same name.
lisp/emacs-lisp/timer.el (timer-until): Subtract results of
float-time, instead of taking float-time of the result of
time-subtract, since float-time signals an error for negative time
arguments.
2012-06-30 15:32:51 +00:00
|
|
|
#define PRIuMAX "llu"
|
Fix the MSDOS build.
src/unexcoff.c [MSDOS]: Include libc/atexit.h.
(copy_text_and_data): Zero out the atexit chain pointer before
dumping Emacs.
src/termhooks.h (encode_terminal_code): Update prototype.
src/term.c (encode_terminal_code) [DOS_NT]: Make it externally
visible for all DOS_NT ports, not just WINDOWSNT.
(syms_of_term) [!MSDOS]: Don't define 'tty-menu-*' symbols on MSDOS.
src/sysdep.c (emacs_sigaction_init, init_signals): Don't use SIGCHLD
unless it is defined.
(emacs_pipe) [MSDOS]: Redirect to 'pipe'.
src/process.c (close_on_exec, accept4, process_socket): Move into
the "ifdef subprocesses" part.
(catch_child_signal): Condition by "ifdef subprocesses".
(syms_of_process) <Qinternal_default_process_sentinel>
<Qinternal_default_process_filter>: Condition by "ifdef subprocesses".
src/msdos.h: Add prototypes for new functions.
(EINPROGRESS): Define.
(O_CLOEXEC): Define to zero.
src/msdos.c (check_window_system): Remove unnecessary an
incompatible duplicate function.
(sys_opendir, readlinkat, faccessat, fstatat, unsetenv): New
functions in support of new functionality.
src/menu.c (single_menu_item): Add visual indication of submenu
also for menus on MSDOS frames.
(Fx_popup_menu) [!MSDOS]: Do not call tty_menu_show on MSDOS.
src/lisp.h (CHECK_PROCESS) [!subprocesses]: Do not define
when async subprocesses aren't supported.
src/font.h (FONT_WIDTH) [MSDOS]: MSDOS-specific definition.
src/emacs.c (close_output_streams): Zero out errno before calling
close_stream.
src/dired.c [MSDOS]: Include msdos.h.
src/conf_post.h (opendir) [MSDOS]: Redirect to sys_opendir.
(DATA_START) [MSDOS]: Define.
(SYSTEM_PURESIZE_EXTRA) [MSDOS]: Enlarge by 25K.
src/callproc.c (block_child_signal, unblock_child_signal) [MSDOS]:
Ifdef away for MSDOS.
(record_kill_process) [MSDOS]: Ifdef away the entire body for MSDOS.
(call_process_cleanup) [MSDOS]: Ifdef away portions not relevant
for MSDOS.
(call_process) [MSDOS]: Fix call sequence of dostounix_filename.
Use temporary file template that is compatible with mkostemp.
Move vfork-related portions under #ifndef MSDOS.
(syms_of_callproc): Unify templates of MSDOS and WINDOWSNT.
lisp/term/pc-win.el (x-list-fonts, x-get-selection-value): Provide
doc strings, as required by snarf-documentation.
msdos/sedlisp.inp:
msdos/sedlibmk.inp:
msdos/sedleim.inp:
msdos/sed3v2.inp:
msdos/sed2v2.inp:
msdos/sed1v2.inp: Update Sed scripts for Emacs 24.4.
msdos/inttypes.h: Add PRIdMAX.
msdos/INSTALL: Update for Emacs 24.4.
msdos/sedadmin.inp: New file.
2014-04-16 13:27:28 +00:00
|
|
|
#define PRIdMAX "lld"
|
2011-04-30 10:31:17 +00:00
|
|
|
#endif /* __DJGPP__ < 2.04 */
|
|
|
|
|
|
|
|
#endif
|