diff --git a/CHANGES b/CHANGES index f072808..f12b6dc 100644 --- a/CHANGES +++ b/CHANGES @@ -3,7 +3,7 @@ The following are the changes from calc version 2.14.0.11 to date: Fixed a number of typos. Drop support for SunOS, IRIX and MINGW32_NT-5.0 targets. - Drop support for CLOCK_SGI_CYCLE. + Drop support for CLOCK_SGI_CYCLE. Drop testing for __MSDOS__. Minor improvement of various help files. Made format of help files more consistent. @@ -33,6 +33,10 @@ The following are the changes from calc version 2.14.0.11 to date: CALC_CHARBIT. Added have_limits.h to determine if is a system include file. + Test for _WIN64 when testing for _WIN32. + + Now assuming that is availabke under _WIN32 and _WIN64. + The following are the changes from calc version 2.14.0.9 to 2.14.0.10: diff --git a/alloc.h b/alloc.h index 11d8dff..1d405ba 100644 --- a/alloc.h +++ b/alloc.h @@ -42,9 +42,7 @@ # include #else -#if defined(_WIN32) && defined(NOTCYGWIN) #include -#endif # if defined(HAVE_NEWSTR) E_FUNC void *memcpy(); diff --git a/calc.c b/calc.c index 71115f8..5ff1d2c 100644 --- a/calc.c +++ b/calc.c @@ -29,14 +29,14 @@ #include #include -#if !defined (_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) # include #endif #include #include -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) # include # if !defined(NOTCYGWIN) /* @@ -704,7 +704,7 @@ main(int argc, char **argv) if (!p_flag && i_flag && !stdin_tty) { closeinput(); if(!freopen("/dev/tty", "r", stdin)) { -#if defined (_WIN32) +#if defined(_WIN32) || defined(_WIN64) fprintf(stderr, "/dev/tty does not exist on " "this operating system. " @@ -734,7 +734,7 @@ main(int argc, char **argv) !p_flag && (!havecommands||i_flag)) { closeinput(); if(!freopen("/dev/tty", "r", stdin)) { -#if defined (_WIN32) +#if defined(_WIN32) || defined(_WIN64) fprintf(stderr, "/dev/tty does not exist on " "this operating system. " diff --git a/calc.h b/calc.h index 0ac7e1a..1a57f3f 100644 --- a/calc.h +++ b/calc.h @@ -59,7 +59,7 @@ #define HOMECHAR '~' /* char which indicates home directory */ #define DOTCHAR '.' /* char which indicates current directory */ #define PATHCHAR '/' /* char which separates path components */ -#if defined(__MSDOS__) || defined(__WIN32) +#if defined(_WIN32) || defined(_WIN64) #define LISTCHAR ';' /* char which separates paths in a list */ #else #define LISTCHAR ':' /* char which separates paths in a list */ @@ -123,7 +123,7 @@ E_FUNC int get_inode(FILEID id, ZVALUE *ino); E_FUNC FILEID reopenid(FILEID id, char *mode, char *name); E_FUNC int closeall(void); -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) E_FUNC int flushall(void); #endif @@ -186,7 +186,7 @@ E_FUNC char *calc_strdup(CONST char *); */ E_FUNC void initialize(void); E_FUNC void reinitialize(void); -#if !defined (_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) E_FUNC int isatty(int tty); /* TRUE if fd is a tty */ #endif E_FUNC char *version(void); /* return version string */ diff --git a/codegen.c b/codegen.c index e005937..0867b1f 100644 --- a/codegen.c +++ b/codegen.c @@ -44,9 +44,11 @@ #include "conf.h" #include "strl.h" -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) || defined(_WIN64) +#if !defined(__CYGWIN__) # include #endif +#endif #include "banned.h" /* include after system header <> includes */ diff --git a/config.c b/config.c index a3858c6..4c0f1bd 100644 --- a/config.c +++ b/config.c @@ -176,7 +176,7 @@ CONFIG oldstd = { /* backward compatible standard configuration */ CTRL_D_VIRGIN_EOF, /* ^D only exits on virgin lines */ NULL, /* our name */ NULL, /* basename of our name */ -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) TRUE, /* running under windows */ #else FALSE, /* congrats, you are not using windows */ @@ -236,7 +236,7 @@ CONFIG newstd = { /* new non-backward compatible configuration */ CTRL_D_VIRGIN_EOF, /* ^D only exits on virgin lines */ NULL, /* our name */ NULL, /* basename of our name */ -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) TRUE, /* running under windows */ #else FALSE, /* congrats, you are not using windows */ diff --git a/decl.h b/decl.h index c9eb7b1..6ba4274 100644 --- a/decl.h +++ b/decl.h @@ -54,7 +54,7 @@ /* * MS Windows macros */ -#elif defined(_WIN32) || defined(WINDOZ) +#elif defined(_WIN32) || defined(_WIN64) /* determine which type of DLL we must generate */ diff --git a/file.c b/file.c index bccf41f..f1ee34e 100644 --- a/file.c +++ b/file.c @@ -46,7 +46,7 @@ #include "calcerr.h" #include "strl.h" -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) # include #endif @@ -728,7 +728,7 @@ flushid(FILEID id) } -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) int flushall(void) { diff --git a/func.c b/func.c index 02d8fb5..b0359fe 100644 --- a/func.c +++ b/func.c @@ -33,7 +33,7 @@ #include -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) # include # define _access access #endif @@ -7474,7 +7474,7 @@ f_fflush(int count, VALUE **vals) i = 0; errno = 0; if (count == 0) { -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) i = flushall(); #endif /* Windows free systems */ } else { @@ -9043,7 +9043,7 @@ f_system(VALUE *vp) if (conf->calc_debug & CALCDBG_SYSTEM) { printf("%s\n", vp->v_str->s_str); } -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) /* if the execute length is 0 then just return 0 */ if (vp->v_str->s_len == 0) { result.v_num = itoq((long)0); @@ -9066,7 +9066,7 @@ f_sleep(int count, VALUE **vals) res.v_type = V_NULL; res.v_subtype = V_NOSUBTYPE; -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) if (count > 0) { if (vals[0]->v_type != V_NUM || qisneg(vals[0]->v_num)) return error_value(E_SLEEP); diff --git a/have_offscl.c b/have_offscl.c index 7ab331c..105991e 100644 --- a/have_offscl.c +++ b/have_offscl.c @@ -69,7 +69,7 @@ main(void) if (value > (off_t)1) { --value; } -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) if (value <= (off_t)getppid()) { --value; } diff --git a/have_posscl.c b/have_posscl.c index b574ac5..798d612 100644 --- a/have_posscl.c +++ b/have_posscl.c @@ -69,7 +69,7 @@ main(void) if (value > (FILEPOS)1) { --value; } -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) if (value <= (FILEPOS)getppid()) { --value; } diff --git a/help.c b/help.c index 3f8145f..356b98d 100644 --- a/help.c +++ b/help.c @@ -40,7 +40,7 @@ #include #endif -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) # define popen _popen # define pclose _pclose #endif diff --git a/hist.c b/hist.c index e13ce51..1c2eb61 100644 --- a/hist.c +++ b/hist.c @@ -36,7 +36,7 @@ #include #include -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) # include #endif diff --git a/hist.h b/hist.h index 411bb39..7965513 100644 --- a/hist.h +++ b/hist.h @@ -46,7 +46,7 @@ #define HOMECHAR '~' /* char which indicates home directory */ #define DOTCHAR '.' /* char which indicates current directory */ #define PATHCHAR '/' /* char which separates path components */ -#if defined(__MSDOS__) || defined(__WIN32) +#if defined(_WIN32) || defined(_WIN64) #define LISTCHAR ';' /* char which separates paths in a list */ #else #define LISTCHAR ':' /* char which separates paths in a list */ diff --git a/input.c b/input.c index 162f092..d8f761a 100644 --- a/input.c +++ b/input.c @@ -31,7 +31,7 @@ #include #include -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) # include #else # include @@ -407,7 +407,7 @@ f_pathopen(char *name, char *mode, char *pathlist, char **openpath) S_FUNC char * homeexpand(char *name) { -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) return NULL; @@ -969,12 +969,12 @@ runrcfiles(void) * a given device/inode, -1 otherwise. * * - * WIN32 NOTE: + * _WIN32 and _WIN64 NOTE: * - * This function does not work under WIN32. The sbuf->st_ino is always + * This function does not work under _WIN32 or _WIN64. The sbuf->st_ino is always * zero because the FAT and NTFS filesystems do not support inodes. * They also don't support links, which is why you need this function - * under UNIX. For WIN32, use _fullpath() to determine if you have + * under UNIX. For _WIN32 or _WIN64, use _fullpath() to determine if you have * already opened a file. * * given: @@ -994,7 +994,7 @@ isinoderead(struct stat *sbuf) /* scan the entire readset */ for (i=0; i < maxreadset; ++i) { -#if defined(_WIN32) || defined(__MSDOS__) +#if defined(_WIN32) || defined(_WIN64) char tmp[MSDOS_MAX_PATH+1]; tmp[MSDOS_MAX_PATH] = '\0'; if (_fullpath(tmp, cip->i_name, MSDOS_MAX_PATH) && @@ -1120,10 +1120,10 @@ addreadset(char *name, char *path, struct stat *sbuf) return -1; } strlcpy(readset[ret].name, name, name_len+1); -#if defined(_WIN32) || defined(__MSDOS__) +#if defined(_WIN32) || defined(_WIN64) /* - * For WIN32, _fullpath expands the path to a fully qualified - * path name, which under WIN32 FAT and NTFS is unique, just + * For _WIN32 or _WIN64, _fullpath expands the path to a fully qualified + * path name, which under _WIN32 or _WIN64 FAT and NTFS is unique, just * like UNIX inodes. _fullpath also allocated the memory for * this new longer path name. */ diff --git a/lib_calc.c b/lib_calc.c index 84f2ff2..58db95a 100644 --- a/lib_calc.c +++ b/lib_calc.c @@ -29,7 +29,7 @@ #include #include -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) # include #endif @@ -84,7 +84,7 @@ typedef struct {int fd;} ttystruct; #endif -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) # if !defined(USE_SGTTY) && !defined (USE_TERMIOS) && !defined(USE_TERMIO) -=*#*=- A Windows free system without termio, termios or sgtty!!! -=*#*=- @@ -240,7 +240,7 @@ libcalc_call_me_first(void) * Disable SIGPIPE so that the pipe to the help file pager will * not stop calc. */ -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) (void) signal(SIGPIPE, SIG_IGN); #endif @@ -249,7 +249,7 @@ libcalc_call_me_first(void) */ if (program != NULL) { p = strrchr(program, '/'); -#if defined(_WIN32) || defined(__MSDOS__) +#if defined(_WIN32) || defined(_WIN64) if (p == NULL) { p = strrchr(program, '\\'); } @@ -481,7 +481,7 @@ cvmalloc_error(char *message) S_FUNC void initenv(void) { -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) struct passwd *ent; /* our password entry */ #endif char *c; @@ -512,7 +512,7 @@ initenv(void) /* determine the $HOME value */ c = (no_env ? NULL : getenv(HOME)); home = (c ? strdup(c) : NULL); -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) if (home == NULL || home[0] == '\0') { /* free home if it was previously allocated, but empty */ if (home != NULL) { diff --git a/seed.c b/seed.c index 4809683..5e0546e 100644 --- a/seed.c +++ b/seed.c @@ -47,7 +47,7 @@ #include #endif -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) # include # define pid_t int #endif @@ -75,7 +75,7 @@ #if defined(HAVE_SYS_TIMES_H) #include #endif -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) # include #endif #if defined(HAVE_STDLIB_H) @@ -372,7 +372,7 @@ pseudo_seed(void) struct timeval tp; /* time of day */ #endif pid_t getpid; /* process ID */ -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) pid_t getppid; /* parent process ID */ #endif #if defined(HAVE_UID_T) @@ -518,7 +518,7 @@ pseudo_seed(void) (void) gettimeofday(&sdata.tp, NULL); #endif sdata.getpid = getpid(); -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(_WIN64) sdata.getppid = getppid(); #endif #if defined(HAVE_UID_T)