summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-08-07 20:01:29 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-08-07 20:01:29 -0700
commit5c1463104d59237000263dc6f682715f0b2abe3e (patch)
tree8faeaff0dde19eb893f9fa60b21e18eb8e8e7ee4 /eval.c
parentc293139b066d728ad68d48dfe25292e72621645d (diff)
downloadtxr-5c1463104d59237000263dc6f682715f0b2abe3e.tar.gz
txr-5c1463104d59237000263dc6f682715f0b2abe3e.tar.bz2
txr-5c1463104d59237000263dc6f682715f0b2abe3e.zip
No getppid on MinGW.
* configure: Add test for getppid. * eval.c (getppid_wrap, eval_init): use HAVE_GETPPID
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 06963cc3..c66ddbef 100644
--- a/eval.c
+++ b/eval.c
@@ -3295,17 +3295,21 @@ static val usleep_wrap(val usec)
}
#if HAVE_UNISTD_H
+
static val getpid_wrap(void)
{
return num(getpid());
}
+#if HAVE_GETPPID
static val getppid_wrap(void)
{
return num(getppid());
}
#endif
+#endif
+
static val env_hash(void)
{
val env_strings = env();
@@ -4011,8 +4015,10 @@ void eval_init(void)
reg_fun(intern(lit("usleep"), user_package), func_n1(usleep_wrap));
#if HAVE_UNISTD_H
reg_fun(intern(lit("getpid"), user_package), func_n0(getpid_wrap));
+#if HAVE_GETPPID
reg_fun(intern(lit("getppid"), user_package), func_n0(getppid_wrap));
#endif
+#endif
reg_fun(intern(lit("env"), user_package), func_n0(env));
reg_fun(intern(lit("env-hash"), user_package), func_n0(env_hash));