Merge from emacs-24; up to 2012-04-26T03:04:36Z!cyd@gnu.org
[bpt/emacs.git] / src / s / cygwin.h
1 /* System description header file for Cygwin.
2
3 Copyright (C) 1985-1986, 1992, 1999, 2002-2012 Free Software Foundation, Inc.
4
5 This file is part of GNU Emacs.
6
7 GNU Emacs is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 GNU Emacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* Emacs can read input using SIGIO and buffering characters itself,
21 or using CBREAK mode and making C-g cause SIGINT.
22 The choice is controlled by the variable interrupt_input.
23
24 Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO)
25
26 Emacs uses the presence or absence of the SIGIO and BROKEN_SIGIO macros
27 to indicate whether or not signal-driven I/O is possible. It uses
28 INTERRUPT_INPUT to decide whether to use it by default.
29
30 SIGIO can be used only on systems that implement it (4.2 and 4.3).
31 CBREAK mode has two disadvantages
32 1) At least in 4.2, it is impossible to handle the Meta key properly.
33 I hear that in system V this problem does not exist.
34 2) Control-G causes output to be discarded.
35 I do not know whether this can be fixed in system V.
36
37 Another method of doing input is planned but not implemented.
38 It would have Emacs fork off a separate process
39 to read the input and send it to the true Emacs process
40 through a pipe. */
41 #undef INTERRUPT_INPUT
42
43 /* Define HAVE_PTYS if the system supports pty devices. */
44 #define HAVE_PTYS
45 #define PTY_ITERATION int i; for (i = 0; i < 1; i++) /* ick */
46 #define PTY_NAME_SPRINTF /* none */
47 #define PTY_TTY_NAME_SPRINTF /* none */
48 #define PTY_OPEN \
49 do \
50 { \
51 int dummy; \
52 SIGMASKTYPE mask; \
53 mask = sigblock (sigmask (SIGCHLD)); \
54 if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) \
55 fd = -1; \
56 sigsetmask (mask); \
57 if (fd >= 0) \
58 emacs_close (dummy); \
59 } \
60 while (0)
61
62 /* Define CLASH_DETECTION if you want lock files to be written
63 so that Emacs can tell instantly when you try to modify
64 a file that someone else has modified in his Emacs. */
65 #define CLASH_DETECTION
66
67 /* If the system's imake configuration file defines `NeedWidePrototypes'
68 as `NO', we must define NARROWPROTO manually. Such a define is
69 generated in the Makefile generated by `xmkmf'. If we don't
70 define NARROWPROTO, we will see the wrong function prototypes
71 for X functions taking float or double parameters. */
72 #define NARROWPROTO 1
73
74 /* Used in various places to enable cygwin-specific code changes. */
75 #define CYGWIN 1
76
77 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
78
79 #define HAVE_SOCKETS
80
81 /* Emacs supplies its own malloc, but glib (part of Gtk+) calls
82 memalign and on Cygwin, that becomes the Cygwin-supplied memalign.
83 As malloc is not the Cygwin malloc, the Cygwin memalign always
84 returns ENOSYS. A workaround is to set G_SLICE=always-malloc. */
85 #define G_SLICE_ALWAYS_MALLOC
86
87 /* Send signals to subprocesses by "typing" special chars at them. */
88 #define SIGNALS_VIA_CHARACTERS