aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/compat.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-09-02 23:38:48 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-09-02 23:51:15 +0200
commit4763814c683c50f8a3697b74e764f19c3dacccd5 (patch)
tree386ff43f024705a32310b882f2161b5f86d8820a /src/common/compat.c
parentc12bdb94ecdc44f200a8030dfde4a5ec46053ea6 (diff)
downloadblogc-feature/squareball.tar.gz
blogc-feature/squareball.tar.bz2
blogc-feature/squareball.zip
migrate codebase to use squareball. again :)feature/squareball
Diffstat (limited to 'src/common/compat.c')
-rw-r--r--src/common/compat.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
deleted file mode 100644
index f7394c8..0000000
--- a/src/common/compat.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif /* HAVE_SYS_WAIT_H */
-
-#include <signal.h>
-#include "compat.h"
-
-
-int
-bc_compat_status_code(int waitstatus)
-{
- int rv = waitstatus;
-#if defined(WIFEXITED) && defined(WEXITSTATUS) && defined(WIFSIGNALED) && defined(WTERMSIG)
- if (WIFEXITED(waitstatus)) {
- rv = WEXITSTATUS(waitstatus);
- }
- else if (WIFSIGNALED(waitstatus)) {
- rv = WTERMSIG(waitstatus);
- rv += 128;
- }
-#elif defined(WIN32) || defined(_WIN32)
- if (waitstatus == 3) {
- rv = SIGTERM + 128; // can't get signal on windows.
- }
-#endif
- return rv;
-}