summaryrefslogtreecommitdiff
path: root/ext/pty
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-12-04 17:16:30 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-12-26 20:45:12 +0900
commit5e22f873ed26092522f9bfc617d729bac88b284f (patch)
tree8d66856526cd7efa87b46c966298e6f42d67e68f /ext/pty
parent33e9601938a79dae149caa88ff1bc06d376dd376 (diff)
decouple internal.h headers
Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies).
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2711
Diffstat (limited to 'ext/pty')
-rw-r--r--ext/pty/pty.c58
1 files changed, 35 insertions, 23 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 4c6ae26127..485f61c304 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -1,45 +1,51 @@
-#include "ruby/config.h"
+#include "ruby/config.h"
+
#ifdef RUBY_EXTCONF_H
-#include RUBY_EXTCONF_H
+# include RUBY_EXTCONF_H
#endif
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <fcntl.h>
-#include <errno.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/file.h>
+#include <fcntl.h>
+
#ifdef HAVE_PWD_H
-#include <pwd.h>
+# include <pwd.h>
#endif
+
#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
+# include <sys/ioctl.h>
#endif
+
#ifdef HAVE_LIBUTIL_H
-#include <libutil.h>
+# include <libutil.h>
#endif
+
#ifdef HAVE_UTIL_H
-#include <util.h>
+# include <util.h>
#endif
+
#ifdef HAVE_PTY_H
-#include <pty.h>
+# include <pty.h>
#endif
+
#if defined(HAVE_SYS_PARAM_H)
- /* for __FreeBSD_version */
+ /* for __FreeBSD_version */
# include <sys/param.h>
#endif
+
#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
+# include <sys/wait.h>
#else
-#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
+# define WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
#endif
-#include <ctype.h>
-
-#include "ruby/io.h"
-#include "internal.h"
-#include "ruby/util.h"
-#include <signal.h>
#ifdef HAVE_SYS_STROPTS_H
#include <sys/stropts.h>
#endif
@@ -48,6 +54,12 @@
#include <unistd.h>
#endif
+#include "internal.h"
+#include "internal/process.h"
+#include "internal/signal.h"
+#include "ruby/io.h"
+#include "ruby/util.h"
+
#define DEVICELEN 16
#ifndef HAVE_SETEUID