*/
#define VERSION_SAVED VERSION
#undef VERSION
-#ifndef WIN32
+#ifndef _WIN32
#include "rrd_config.h"
#endif
#include "rrd_tool.h"
/*
* should not be needed if libc is linked (see ntmake.pl)
-#ifdef WIN32
+#ifdef _WIN32
#define free free
#define malloc malloc
#define realloc realloc
int mutex_init(mutex_t *mutex)
{
-#ifdef WIN32
+#ifdef _WIN32
*mutex = CreateMutex(NULL, FALSE, NULL);
return (*mutex == NULL);
#else
int mutex_lock(mutex_t *mutex)
{
-#ifdef WIN32
+#ifdef _WIN32
if (*mutex == NULL) { /* static initializer? */
HANDLE p = CreateMutex(NULL, FALSE, NULL);
if (InterlockedCompareExchangePointer((PVOID*)mutex, (PVOID)p, NULL) != NULL)
int mutex_unlock(mutex_t *mutex)
{
-#ifdef WIN32
+#ifdef _WIN32
return (ReleaseMutex(*mutex) == 0);
#else
return pthread_mutex_unlock(mutex);
int mutex_cleanup(mutex_t *mutex)
{
-#ifdef WIN32
+#ifdef _WIN32
return (CloseHandle(mutex) == 0);
#else
return pthread_mutex_destroy(mutex);
#ifndef MUTEX_H_B13C67AB432C4C39AF823A339537CA40
#define MUTEX_H_B13C67AB432C4C39AF823A339537CA40
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#include <process.h>
#else
#include <pthread.h>
#endif
-#ifndef WIN32
+#ifndef _WIN32
#define mutex_t pthread_mutex_t
#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
#else
-#ifdef WIN32
+#ifdef _WIN32
/*
*
* Cross-platform basename/dirname
-#ifdef WIN32
+#ifdef _WIN32
/*
*
* Cross-platform basename/dirname
#include <sys/types.h> /* for off_t */
-#ifndef WIN32
+#ifndef _WIN32
#include <unistd.h> /* for off_t */
#else
#ifdef _MSC_VER
/* returns the current per-thread rrd_context */
rrd_context_t *rrd_get_context(void);
-#ifdef WIN32
+#ifdef _WIN32
/* this was added by the win32 porters Christof.Wegmann@exitgames.com */
rrd_context_t *rrd_force_new_context(void);
#endif
* Sebastian tokkee Harl <sh at tokkee.org>
**/
-#ifdef WIN32
+#ifdef _WIN32
#include <ws2tcpip.h> // contain #include <winsock2.h>
// Need to link with Ws2_32.lib
#include <string.h>
#include <errno.h>
#include <assert.h>
-#ifndef WIN32
+#ifndef _WIN32
#include <strings.h>
#include <pthread.h>
#include <sys/socket.h>
static void close_socket(rrd_client_t *client)
{
if (client->sd >= 0) {
-#ifdef WIN32
+#ifdef _WIN32
closesocket(client->sd);
WSACleanup();
#else
static int connect_unix(rrd_client_t *client, const char *path) /* {{{ */
{
-#ifdef WIN32
+#ifdef _WIN32
return (WSAEPROTONOSUPPORT);
#else
struct sockaddr_un sa;
}
}
-#ifdef WIN32
+#ifdef _WIN32
WORD wVersionRequested;
WSADATA wsaData;
#include "unused.h"
-#ifdef WIN32
+#ifdef _WIN32
# include <process.h>
#endif
WILL NOT take care of any ACLs that may be set. Go
figure. */
if (stat(outfilename, &stat_buf) != 0) {
-#ifdef WIN32
+#ifdef _WIN32
stat_buf.st_mode = _S_IREAD | _S_IWRITE; // have to test it is
#else
/* an error occurred (file not found, maybe?). Anyway:
rrd_clear_error();
}
-#ifdef WIN32
+#ifdef _WIN32
/* In Windows, renaming to an existing file is not allowed. Even, if the file
* is deleted before, using _unlink() here. Furthermore the FILE_SHARE_DELETE
* flag is required, which is used in CreateFileA in rrd_open.c
# include <stdint.h>
#endif
-#ifndef WIN32
+#ifndef _WIN32
#include <unistd.h>
#include <strings.h>
#include <inttypes.h>
#include "rrd_snprintf.h"
-#if !(defined(NETWARE) || defined(WIN32))
+#if !(defined(NETWARE) || defined(_WIN32))
extern char *tzname[2];
#endif
* rrd_format.c RRD Database Format helper functions
*****************************************************************************/
#include "rrd_tool.h"
-#ifdef WIN32
+#ifdef _WIN32
#include "stdlib.h"
#endif
-#if defined(WIN32) && !defined(__MINGW32__)
+#if defined(_WIN32) && !defined(__MINGW32__)
#include "strftime.h"
#endif
#include "plbasename.h"
#endif
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
#include <io.h>
#include <fcntl.h>
#endif
#include <locale.h>
#include "rrd_config.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
* $Id$
*****************************************************************************/
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#if _WIN32_MAXVER >= 0x0602 /* _WIN32_WINNT_WIN8 */
#include <synchapi.h>
#define MEMBLK 8192
-#ifdef WIN32
+#ifdef _WIN32
#define _LK_UNLCK 0 /* Unlock */
#define _LK_LOCK 1 /* Lock */
#define _LK_NBLCK 2 /* Non-blocking lock */
#include <libxml/xmlreader.h>
#include <locale.h>
-#ifndef WIN32
+#ifndef _WIN32
# include <unistd.h> /* for off_t */
#else
#ifndef __MINGW32__ /* MinGW-w64 has ssize_t and off_t */
#include "rrd_config.h"
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
#include <stdlib.h>
#include <sys/stat.h>
#include <io.h>
according to localeconv(3) */
setlocale(LC_ALL, "");
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && !defined(__CYGWIN__)
setmode(fileno(stdout), O_BINARY);
setmode(fileno(stdin), O_BINARY);
#endif
#include <libgen.h>
#include <unistd.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
# define random() rand()
# define srandom(x) srand(x)
# define getpid() 0