#define lstat __la_stat
#define open __la_open
#define read __la_read
-#if !defined(__BORLANDC__)
+#if !defined(__BORLANDC__) && !defined(__WATCOMC__)
#define setmode _setmode
#endif
#ifdef stat
#undef stat
#endif
#define stat(path,stref) __la_stat(path,stref)
+#if !defined(__WATCOMC__)
#if !defined(__BORLANDC__)
#define strdup _strdup
#endif
#if !defined(__BORLANDC__)
#define umask _umask
#endif
+#endif
#define waitpid __la_waitpid
#define write __la_write
+#if !defined(__WATCOMC__)
+
#ifndef O_RDONLY
#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
#define S_IWOTH _S_IWOTH
#define S_IROTH _S_IROTH
+#endif
+
#define F_DUPFD 0 /* Duplicate file descriptor. */
#define F_GETFD 1 /* Get file descriptor flags. */
#define F_SETFD 2 /* Set file descriptor flags. */
/* Following Info-Zip, store mode in the "external attributes" field. */
archive_le32enc(zip->file_header + 38,
archive_entry_mode(zip->entry) << 16);
- unsigned char *fn = cd_alloc(zip, filename_length);
- /* If (fn == NULL) XXXX */
- copy_path(zip->entry, fn);
+ e = cd_alloc(zip, filename_length);
+ /* If (e == NULL) XXXX */
+ copy_path(zip->entry, e);
/* Format extra data. */
memset(local_extra, 0, sizeof(local_extra));
while (pwd[strlen(pwd) - 1] == '\n')
pwd[strlen(pwd) - 1] = '\0';
-#if defined(HAVE__CrtSetReportMode)
+#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
/* To stop to run the default invalid parameter handler. */
_set_invalid_parameter_handler(invalid_parameter_handler);
/* Disable annoying assertion message box. */
/* If there's real data, return that. */
if (private->buff != NULL) {
*buff = private->buff;
- size = (private->current->buff + private->current->size)
- - private->buff;
+ size = ((char *)private->current->buff + private->current->size)
+ - (char *)private->buff;
private->buff = NULL;
private->fileposition += size;
return (size);
while (private->current != NULL) {
if (offset + private->current->size > private->fileposition) {
/* Position is in this block. */
- private->buff = private->current->buff
+ private->buff = (char *)private->current->buff
+ private->fileposition - offset;
private->gap_remaining = private->current->gap_size;
return private->fileposition;
#endif
#define geteuid() 0
+#ifndef __WATCOMC__
+
#ifndef S_IFIFO
#define S_IFIFO 0010000 /* pipe */
#endif
#define S_ISBLK(a) (0)
#endif
+#endif
+
#endif /* BSDTAR_WINDOWS_H */
while (pwd[strlen(pwd) - 1] == '\n')
pwd[strlen(pwd) - 1] = '\0';
-#if defined(HAVE__CrtSetReportMode)
+#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
/* To stop to run the default invalid parameter handler. */
_set_invalid_parameter_handler(invalid_parameter_handler);
/* Disable annoying assertion message box. */