changeset 18399:959091d9c345

Fix some S_ISDIR calls to work with Visual Studio. --rlaager committer: Richard Laager <rlaager@wiktel.com>
author Nick Hebner <hebnern@gmail.com>
date Sun, 01 Jul 2007 01:46:01 +0000
parents 16bdcffb1c62
children 73829f8055f0
files libpurple/win32/libc_interface.c libpurple/win32/libc_interface.h
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/win32/libc_interface.c	Sun Jul 01 01:41:57 2007 +0000
+++ b/libpurple/win32/libc_interface.c	Sun Jul 01 01:46:01 2007 +0000
@@ -413,8 +413,8 @@
 		/* newname exists */
 		if(g_stat(newname, &newstat) == 0) {
 			/* oldname is a dir */
-			if(_S_ISDIR(oldstat.st_mode)) {
-				if(!_S_ISDIR(newstat.st_mode)) {
+			if(S_ISDIR(oldstat.st_mode)) {
+				if(!S_ISDIR(newstat.st_mode)) {
 					return g_rename(oldname, newname);
 				}
 				/* newname is a dir */
@@ -430,7 +430,7 @@
 			/* oldname is not a dir */
 			else {
 				/* newname is a dir */
-				if(_S_ISDIR(newstat.st_mode)) {
+				if(S_ISDIR(newstat.st_mode)) {
 					errno = EISDIR;
 					return -1;
 				}
--- a/libpurple/win32/libc_interface.h	Sun Jul 01 01:41:57 2007 +0000
+++ b/libpurple/win32/libc_interface.h	Sun Jul 01 01:46:01 2007 +0000
@@ -29,6 +29,16 @@
 #include "libc_internal.h"
 #include <glib.h>
 
+#ifdef _MSC_VER
+#define S_IRUSR S_IREAD
+#define S_IWUSR S_IWRITE
+#define S_IXUSR S_IEXEC
+
+#define S_ISDIR(m)	 (((m)&S_IFDIR)==S_IFDIR)
+
+#define F_OK 0
+#endif
+
 /* sys/socket.h */
 #define socket( namespace, style, protocol ) \
 wpurple_socket( namespace, style, protocol )