patch 8.1.0941: macros for MS-Windows are inconsistent
Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and
others.
Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the
GUI build. (Hirohito Higashi, closes #3932)
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 4bf2072..5418804 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1048,7 +1048,7 @@
void
profile_start(proftime_T *tm)
{
-# ifdef WIN3264
+# ifdef MSWIN
QueryPerformanceCounter(tm);
# else
gettimeofday(tm, NULL);
@@ -1063,7 +1063,7 @@
{
proftime_T now;
-# ifdef WIN3264
+# ifdef MSWIN
QueryPerformanceCounter(&now);
tm->QuadPart = now.QuadPart - tm->QuadPart;
# else
@@ -1084,7 +1084,7 @@
void
profile_sub(proftime_T *tm, proftime_T *tm2)
{
-# ifdef WIN3264
+# ifdef MSWIN
tm->QuadPart -= tm2->QuadPart;
# else
tm->tv_usec -= tm2->tv_usec;
@@ -1106,7 +1106,7 @@
{
static char buf[50];
-# ifdef WIN3264
+# ifdef MSWIN
LARGE_INTEGER fr;
QueryPerformanceFrequency(&fr);
@@ -1124,7 +1124,7 @@
float_T
profile_float(proftime_T *tm)
{
-# ifdef WIN3264
+# ifdef MSWIN
LARGE_INTEGER fr;
QueryPerformanceFrequency(&fr);
@@ -1145,7 +1145,7 @@
profile_zero(tm);
else
{
-# ifdef WIN3264
+# ifdef MSWIN
LARGE_INTEGER fr;
QueryPerformanceCounter(tm);
@@ -1170,7 +1170,7 @@
{
proftime_T now;
-# ifdef WIN3264
+# ifdef MSWIN
if (tm->QuadPart == 0) /* timer was not set */
return FALSE;
QueryPerformanceCounter(&now);
@@ -1190,7 +1190,7 @@
void
profile_zero(proftime_T *tm)
{
-# ifdef WIN3264
+# ifdef MSWIN
tm->QuadPart = 0;
# else
tm->tv_usec = 0;
@@ -1207,7 +1207,7 @@
long
proftime_time_left(proftime_T *due, proftime_T *now)
{
-# ifdef WIN3264
+# ifdef MSWIN
LARGE_INTEGER fr;
if (now->QuadPart > due->QuadPart)
@@ -1592,7 +1592,7 @@
profile_zero(tm2);
else
{
-# ifdef WIN3264
+# ifdef MSWIN
tm2->QuadPart = tm->QuadPart / count;
# else
double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count;
@@ -1617,7 +1617,7 @@
void
profile_add(proftime_T *tm, proftime_T *tm2)
{
-# ifdef WIN3264
+# ifdef MSWIN
tm->QuadPart += tm2->QuadPart;
# else
tm->tv_usec += tm2->tv_usec;
@@ -1638,7 +1638,7 @@
{
/* Check that the result won't be negative. Can happen with recursive
* calls. */
-#ifdef WIN3264
+#ifdef MSWIN
if (total->QuadPart <= children->QuadPart)
return;
#else
@@ -1678,7 +1678,7 @@
int
profile_equal(proftime_T *tm1, proftime_T *tm2)
{
-# ifdef WIN3264
+# ifdef MSWIN
return (tm1->QuadPart == tm2->QuadPart);
# else
return (tm1->tv_usec == tm2->tv_usec && tm1->tv_sec == tm2->tv_sec);
@@ -1691,7 +1691,7 @@
int
profile_cmp(const proftime_T *tm1, const proftime_T *tm2)
{
-# ifdef WIN3264
+# ifdef MSWIN
return (int)(tm2->QuadPart - tm1->QuadPart);
# else
if (tm1->tv_sec == tm2->tv_sec)
@@ -4286,7 +4286,7 @@
static char_u *get_one_sourceline(struct source_cookie *sp);
-#if (defined(WIN32) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC)
+#if (defined(MSWIN) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC)
# define USE_FOPEN_NOINH
/*
* Special function to open a file without handle inheritance.
@@ -4295,7 +4295,7 @@
static FILE *
fopen_noinh_readbin(char *filename)
{
-# ifdef WIN32
+# ifdef MSWIN
int fd_tmp = mch_open(filename, O_RDONLY | O_BINARY | O_NOINHERIT, 0);
# else
int fd_tmp = mch_open(filename, O_RDONLY, 0);
@@ -5201,7 +5201,7 @@
/* Obtain the locale value from the libraries. */
loc = (char_u *)setlocale(what, NULL);
-# ifdef WIN32
+# ifdef MSWIN
if (loc != NULL)
{
char_u *p;
@@ -5230,7 +5230,7 @@
#endif
-#ifdef WIN32
+#ifdef MSWIN
/*
* On MS-Windows locale names are strings like "German_Germany.1252", but
* gettext expects "de". Try to translate one into another here for a few
@@ -5307,7 +5307,7 @@
p = mch_getenv((char_u *)"LANG");
}
# endif
-# ifdef WIN32
+# ifdef MSWIN
p = gettext_lang(p);
# endif
return is_valid_mess_lang(p) ? p : NULL;
@@ -5479,7 +5479,7 @@
/* Clear $LANGUAGE because GNU gettext uses it. */
vim_setenv((char_u *)"LANGUAGE", (char_u *)"");
-# ifdef WIN32
+# ifdef MSWIN
/* Apparently MS-Windows printf() may cause a crash when
* we give it 8-bit text while it's expecting text in the
* current locale. This call avoids that. */
@@ -5489,7 +5489,7 @@
if (what != LC_CTYPE)
{
char_u *mname;
-#ifdef WIN32
+#ifdef MSWIN
mname = gettext_lang(name);
#else
mname = name;
@@ -5516,7 +5516,7 @@
static char_u **locales = NULL; /* Array of all available locales */
-# ifndef WIN32
+# ifndef MSWIN
static int did_init_locales = FALSE;
/* Return an array of strings for all available locales + NULL for the
@@ -5567,7 +5567,7 @@
static void
init_locales(void)
{
-# ifndef WIN32
+# ifndef MSWIN
if (!did_init_locales)
{
did_init_locales = TRUE;