diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-01-08 23:03:50 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-01-08 23:03:50 +0200 |
commit | 0cc0973babcc4c35557aade37be5926a3f6023c9 (patch) | |
tree | f4ae9f5f06a2b4483d6a7bb4ae3eb3e2c92ce98b | |
parent | a56b8c1a4b2495833fedd37b83305f5388cd2c2e (diff) | |
download | egawk-0cc0973babcc4c35557aade37be5926a3f6023c9.tar.gz egawk-0cc0973babcc4c35557aade37be5926a3f6023c9.tar.bz2 egawk-0cc0973babcc4c35557aade37be5926a3f6023c9.zip |
PC fiexes from Eli.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | awk.h | 10 | ||||
-rw-r--r-- | io.c | 15 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | pc/ChangeLog | 11 | ||||
-rw-r--r-- | pc/config.h | 16 | ||||
-rw-r--r-- | pc/gawkmisc.pc | 25 | ||||
-rw-r--r-- | pc/popen.c | 4 |
8 files changed, 68 insertions, 29 deletions
@@ -1,3 +1,15 @@ +Sat Jan 8 23:00:37 2011 Arnold D. Robbins <arnold@skeeve.com> + + * awk.h: Include <fcntl.h> here. + * main.c, io.c: Remove includes of <fcntl.h>. + +2011-01-08 Eli Zaretskii <eliz@gnu.org> + + * io.c (PIPES_SIMULATED) [__DJGPP__ || __MINGW32__]: Define. + (binmode): Define for __DJGPP__ and __MINGW32__ as well. + (gawk_popen) [!PIPES_SIMULATED]: Define for __DJGPP__ and + __MINGW32__ as well. + Wed Jan 5 20:35:30 2011 Arnold D. Robbins <arnold@skeeve.com> * configure.ac: Move call to AC_LANG([C]) into here from @@ -49,6 +49,12 @@ #endif /* HAVE_LIMITS_H */ #include <ctype.h> #include <setjmp.h> +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif +#ifndef O_BINARY +#define O_BINARY 0 +#endif #include "gettext.h" #define _(msgid) gettext(msgid) @@ -147,10 +153,6 @@ typedef int off_t; #endif /* HAVE_STRINGS_H */ #endif /* not HAVE_STRING_H */ -#if ! defined(O_BINARY) -#define O_BINARY 0 -#endif - #if HAVE_UNISTD_H #include <unistd.h> #endif /* HAVE_UNISTD_H */ @@ -35,9 +35,6 @@ #include <sys/param.h> #endif /* HAVE_SYS_PARAM_H */ -#ifndef O_RDONLY -#include <fcntl.h> -#endif #ifndef O_ACCMODE #define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) #endif @@ -128,6 +125,10 @@ #undef TANDEM /* AIX defines this in one of its header files */ #endif +#if defined(__DJGPP__) || defined(__MINGW32__) +#define PIPES_SIMULATED +#endif + typedef enum { CLOSE_ALL, CLOSE_TO, CLOSE_FROM } two_way_close_type; /* Several macros make the code a bit clearer: */ @@ -222,7 +223,7 @@ extern NODE *ARGIND_node; extern NODE *ERRNO_node; extern NODE **fields_arr; -#if defined(__EMX__) || defined(__CYGWIN__) +#if defined(__DJGPP__) || defined(__MINGW32__) || defined(__EMX__) || defined(__CYGWIN__) /* binmode --- convert BINMODE to string for fopen */ static const char * @@ -2084,7 +2085,7 @@ gawk_pclose(struct redirect *rp) * except if popen() provides real pipes too */ -#if defined(VMS) || defined(__EMX__) +#if defined(__DJGPP__) || defined(__MINGW32__) || defined(VMS) || defined(__EMX__) /* gawk_popen --- open an IOBUF on a child process */ @@ -2125,7 +2126,7 @@ gawk_pclose(struct redirect *rp) rp->ifp = NULL; return (rval < 0 ? rval : aval); } -#else /* not (VMS || __EMX__) */ +#else /* not (__DJGPP__ || __MINGW32__ || VMS || __EMX__) */ static struct pipeinfo { char *command; @@ -2179,7 +2180,7 @@ gawk_pclose(struct redirect *rp) efree(pipes[cur].command); return rval; } -#endif /* not (VMS || __EMX__) */ +#endif /* not (__DJGPP__ || __MINGW32__ || VMS || __EMX__) */ #endif /* PIPES_SIMULATED */ @@ -29,10 +29,6 @@ #include "awk.h" #include "getopt.h" -#ifndef O_BINARY -#include <fcntl.h> -#endif - #ifdef HAVE_MCHECK_H #include <mcheck.h> #endif diff --git a/pc/ChangeLog b/pc/ChangeLog index b6d7be83..1f22bcb5 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,14 @@ +2011-01-08 Eli Zaretskii <eliz@gnu.org> + + * popen.c (scriptify): Fix syntax error. + + * config.h (HAVE___ARGZ_COUNT, HAVE___ARGZ_NEXT) + (HAVE___ARGZ_STRINGIFY): Don't define. + (HAVE_PORTALS): Remove reference. + + * gawkmisc.pc (unsetenv) [__DJGPP__]: Implement. + (usleep) [__MINGW32__]: Resurrect. + Tue Jan 4 11:20:40 2011 Arnold Robbins <arnold@skeeve.com> * config.h: Add PIPES_SIMULATED and definition of _NFILE for diff --git a/pc/config.h b/pc/config.h index a7bd593c..58fe29c6 100644 --- a/pc/config.h +++ b/pc/config.h @@ -219,19 +219,9 @@ #define SPRINTF_RET int /* return type of sprintf */ #define HAVE_MKTIME /* we have the mktime function */ /* #undef HAVE_SOCKETS */ /* we have sockets on this system */ -/* #undef HAVE_PORTALS */ /* we have portals on /p on this system */ /* #undef DYNAMIC */ /* allow dynamic addition of builtins */ /* #undef STRTOD_NOT_C89 */ /* strtod doesn't have C89 semantics */ -/* Define if you have the __argz_count function. */ -#define HAVE___ARGZ_COUNT 1 - -/* Define if you have the __argz_next function. */ -#define HAVE___ARGZ_NEXT 1 - -/* Define if you have the __argz_stringify function. */ -#define HAVE___ARGZ_STRINGIFY 1 - /* Define if you have the alarm function. */ #define HAVE_ALARM 1 @@ -287,10 +277,12 @@ /* Define to 1 if you have the <sys/socket.h> header file. */ #undef HAVE_SYS_SOCKET_H -#endif +#endif /* __MINGW32__ */ +#if defined(__MINGW32__) || defined(__DJGPP__) /* Define if you have the setenv function. */ -/* #define HAVE_SETENV */ +#define HAVE_SETENV 1 +#endif /* Define if you have the stpcpy function. */ /* #undef HAVE_STPCPY */ diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc index 0fd3a8f4..74a2d7db 100644 --- a/pc/gawkmisc.pc +++ b/pc/gawkmisc.pc @@ -496,4 +496,29 @@ unsetenv (const char *name) return setenv (name, "", 1); } +#include <windows.h> + +int +usleep(unsigned int usec) +{ + double msecf = usec / 1000.0; + + Sleep ((DWORD)msecf); + + return usec - msecf * 1000 < 0 ? 0 : (int)(usec - msecf * 1000); +} + #endif /* __MINGW32__ */ + +#ifdef __DJGPP__ + +int +unsetenv (const char *name) +{ + if (!name || !*name || strchr (name, '=') != NULL) + return -1; + + return putenv (name); +} + +#endif /* __DJGPP__ */ @@ -90,8 +90,8 @@ scriptify(const char *command) i = strlen(command); if ((fwrite(command, 1, i, fp) < i) || (fputc('\n', fp) == EOF)) { free(cmd); - cmd = NULL; - { + cmd = NULL; + } } else { free(cmd); cmd = NULL; |