/* * nonposix.h --- definitions needed on non-POSIX systems. */ /* * Copyright (C) 2012, 2013 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * GAWK 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 * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* * This is for fake directory file descriptors on systems that don't * allow to open() a directory. */ #define FAKE_FD_VALUE 42 #ifdef __MINGW32__ /* Replacements for sys/wait.h macros. */ # define WEXITSTATUS(stv) (((unsigned)(stv)) & ~0xC0000000) /* MS-Windows programs that crash due to a fatal exception exit with an exit code whose 2 MSB bits are set. */ # define WIFEXITED(stv) ((((unsigned)(stv)) & 0xC0000000) == 0) # define WIFSIGNALED(stv) ((((unsigned)(stv)) & 0xC0000000) == 0xC0000000) # define WTERMSIG(stv) w32_status_to_termsig ((unsigned)stv) # define WIFSTOPPED(stv) (0) # define WSTOPSIG(stv) (0) int w32_status_to_termsig (unsigned); #endif