summaryrefslogtreecommitdiff
path: root/cups/globals.c
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-10-10 00:17:22 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2018-10-10 00:17:22 -0400
commit19dc16f764492eb3b1cf7c57b7f645e214cb9b3a (patch)
tree1a40bc2a71ace7f53463f8c7f823b6419e648242 /cups/globals.c
parentd65e20fe7c5b192522ba01865bfcbd3dbc0e448e (diff)
downloadcups-19dc16f764492eb3b1cf7c57b7f645e214cb9b3a.tar.gz
Migrate Windows conditional code to _WIN32 define.
Diffstat (limited to 'cups/globals.c')
-rw-r--r--cups/globals.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/cups/globals.c b/cups/globals.c
index e91d77900..d67c752ce 100644
--- a/cups/globals.c
+++ b/cups/globals.c
@@ -28,23 +28,23 @@ static _cups_threadkey_t cups_globals_key = _CUPS_THREADKEY_INITIALIZER;
static pthread_once_t cups_globals_key_once = PTHREAD_ONCE_INIT;
/* One-time initialization object */
#endif /* HAVE_PTHREAD_H */
-#if defined(HAVE_PTHREAD_H) || defined(WIN32)
+#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
static _cups_mutex_t cups_global_mutex = _CUPS_MUTEX_INITIALIZER;
/* Global critical section */
-#endif /* HAVE_PTHREAD_H || WIN32 */
+#endif /* HAVE_PTHREAD_H || _WIN32 */
/*
* Local functions...
*/
-#ifdef WIN32
+#ifdef _WIN32
static void cups_fix_path(char *path);
-#endif /* WIN32 */
+#endif /* _WIN32 */
static _cups_globals_t *cups_globals_alloc(void);
-#if defined(HAVE_PTHREAD_H) || defined(WIN32)
+#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
static void cups_globals_free(_cups_globals_t *g);
-#endif /* HAVE_PTHREAD_H || WIN32 */
+#endif /* HAVE_PTHREAD_H || _WIN32 */
#ifdef HAVE_PTHREAD_H
static void cups_globals_init(void);
#endif /* HAVE_PTHREAD_H */
@@ -59,7 +59,7 @@ _cupsGlobalLock(void)
{
#ifdef HAVE_PTHREAD_H
pthread_mutex_lock(&cups_global_mutex);
-#elif defined(WIN32)
+#elif defined(_WIN32)
EnterCriticalSection(&cups_global_mutex.m_criticalSection);
#endif /* HAVE_PTHREAD_H */
}
@@ -114,13 +114,13 @@ _cupsGlobalUnlock(void)
{
#ifdef HAVE_PTHREAD_H
pthread_mutex_unlock(&cups_global_mutex);
-#elif defined(WIN32)
+#elif defined(_WIN32)
LeaveCriticalSection(&cups_global_mutex.m_criticalSection);
#endif /* HAVE_PTHREAD_H */
}
-#ifdef WIN32
+#ifdef _WIN32
/*
* 'DllMain()' - Main entry for library.
*/
@@ -164,7 +164,7 @@ DllMain(HINSTANCE hinst, /* I - DLL module handle */
return (TRUE);
}
-#endif /* WIN32 */
+#endif /* _WIN32 */
/*
@@ -176,13 +176,13 @@ cups_globals_alloc(void)
{
_cups_globals_t *cg = malloc(sizeof(_cups_globals_t));
/* Pointer to global data */
-#ifdef WIN32
+#ifdef _WIN32
HKEY key; /* Registry key */
DWORD size; /* Size of string */
static char installdir[1024] = "", /* Install directory */
confdir[1024] = "", /* Server root directory */
localedir[1024] = ""; /* Locale directory */
-#endif /* WIN32 */
+#endif /* _WIN32 */
if (!cg)
@@ -213,7 +213,7 @@ cups_globals_alloc(void)
* Then set directories as appropriate...
*/
-#ifdef WIN32
+#ifdef _WIN32
if (!installdir[0])
{
/*
@@ -309,7 +309,7 @@ cups_globals_alloc(void)
if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
cg->localedir = CUPS_LOCALEDIR;
}
-#endif /* WIN32 */
+#endif /* _WIN32 */
return (cg);
}
@@ -319,7 +319,7 @@ cups_globals_alloc(void)
* 'cups_globals_free()' - Free global data.
*/
-#if defined(HAVE_PTHREAD_H) || defined(WIN32)
+#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
static void
cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
{
@@ -354,7 +354,7 @@ cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
free(cg);
}
-#endif /* HAVE_PTHREAD_H || WIN32 */
+#endif /* HAVE_PTHREAD_H || _WIN32 */
#ifdef HAVE_PTHREAD_H