その後の進展もなく記事が古くなってしまったため、patch を作った最終作業記録を残して log 送りにします。 -- shelarcy
新しいものを上にしましょう。
shelarcy (2004/06/02 06:15:10 PDT): stdint.h と inttype.h は C99 のものなので、無いと言われます。次期標準に入るはずですがそれまでは待てません。こういうのが無い場合にはどうやってやっているんでしょうか? (というか有野さんどうやってコンパイルしたんだろう。mingw から取ってくるというのは万人向けではないし……)
#include <boost/cstdint.hpp>
extern __inline__ intmax_t __cdecl imaxabs (intmax_t j) {return (j >= 0 ? j : -j);} imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom); /* 7.8.2 Conversion functions for greatest-width integer types */ intmax_t __cdecl strtoimax (const char* __restrict__ nptr, char** __restrict__ endptr, int base); uintmax_t __cdecl strtoumax (const char* __restrict__ nptr, char** __restrict__ endptr, int base); intmax_t __cdecl wcstoimax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, int base); uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, int base);
上記 patch の問題点
#ifdef WIN32_NATIVE #include <io.h> #else #include <unistd.h> #endifをやらないと、後々響く気がする。
+#ifndef WIN32_NATIVE +#define HAVE_A_SIGHUP +#define HAVE_A_SIGQUIT +#define HAVE_A_SIGKILL +#define HAVE_A_SIGUSR1 +#define HAVE_A_SIGUSR2 +#define HAVE_A_SIGPIPE +#define HAVE_A_SIGALRM +#define HAVE_A_SIGCHLD +#define HAVE_A_SIGCONT +#define HAVE_A_SIGSTOP +#define HAVE_A_SIGTSTP +#define HAVE_A_SIGTTIN +#define HAVE_A_SIGTTOU +#define HAVE_A_PASSWD +#endif + + /* Master signal handler vector. */ static struct sigHandlersRec { sigset_t masterSigset; /* The signals Gauche is _allowed_ to handle. @@ -80,9 +98,13 @@ int num; int defaultHandle; } sigDesc[] = { +#ifdef HAVE_A_SIGHUP SIGDEF(SIGHUP, SIGDEF_EXIT), /* Hangup (POSIX) */ +#endif SIGDEF(SIGINT, SIGDEF_ERROR), /* Interrupt (ANSI) */ +#ifdef HAVE_A_SIGQUIT SIGDEF(SIGQUIT, SIGDEF_EXIT), /* Quit (POSIX) */ +#endif SIGDEF(SIGILL, SIGDEF_NOHANDLE), /* Illegal instruction (ANSI) */ #ifdef SIGTRAP SIGDEF(SIGTRAP, SIGDEF_ERROR), /* Trace trap */ @@ -95,22 +117,44 @@ SIGDEF(SIGBUS, SIGDEF_NOHANDLE), /* BUS error (4.2 BSD) */ #endif SIGDEF(SIGFPE, SIGDEF_ERROR), /* Floating-point exception (ANSI) */ +#ifdef HAVE_A_SIGKILL SIGDEF(SIGKILL, SIGDEF_NOHANDLE), /* Kill, unblockable (POSIX) */ +#endif +#ifdef HAVE_A_SIGUSR1 SIGDEF(SIGUSR1, SIGDEF_ERROR), /* User-defined signal 1 (POSIX) */ +#endif SIGDEF(SIGSEGV, SIGDEF_NOHANDLE), /* Segmentation violation (ANSI) */ +#ifdef HAVE_A_SIGUSR2 SIGDEF(SIGUSR2, SIGDEF_ERROR), /* User-defined signal 2 (POSIX) */ +#endif +#ifdef HAVE_A_SIGPIPE SIGDEF(SIGPIPE, SIGDEF_ERROR), /* Broken pipe (POSIX) */ +#endif +#ifdef HAVE_A_SIGALRM SIGDEF(SIGALRM, SIGDEF_ERROR), /* Alarm clock (POSIX) */ +#endif SIGDEF(SIGTERM, SIGDEF_EXIT), /* Termination (ANSI) */ #ifdef SIGSTKFLT SIGDEF(SIGSTKFLT, SIGDEF_ERROR), /* Stack fault */ #endif +#ifdef HAVE_A_SIGCHLD SIGDEF(SIGCHLD, SIGDEF_NOHANDLE), /* Child status has changed (POSIX) */ +#endif +#ifdef HAVE_A_SIGCONT SIGDEF(SIGCONT, SIGDEF_NOHANDLE), /* Continue (POSIX) */ +#endif +#ifdef HAVE_A_SIGSTOP SIGDEF(SIGSTOP, SIGDEF_NOHANDLE), /* Stop, unblockable (POSIX) */ +#endif +#ifdef HAVE_A_SIGTSTP SIGDEF(SIGTSTP, SIGDEF_NOHANDLE), /* Keyboard stop (POSIX) */ +#endif +#ifdef HAVE_A_SIGTTIN SIGDEF(SIGTTIN, SIGDEF_NOHANDLE), /* Background read from tty (POSIX) */ +#endif +#ifdef HAVE_A_SIGTTOU SIGDEF(SIGTTOU, SIGDEF_NOHANDLE), /* Background write to tty (POSIX) */ +#endif #ifdef SIGURG SIGDEF(SIGURG, SIGDEF_NOHANDLE), /* Urgent condition on socket (4.2 BSD) */ #endifこれの意義が良く分からない
http://members.tripod.co.jp/k_arino/patch.txt