[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[rdiff-backup-users] First Win32 patch
From: |
Greg Freemyer |
Subject: |
[rdiff-backup-users] First Win32 patch |
Date: |
Tue, 18 Mar 2003 19:23:08 -0500 |
Ben,
I think I'm starting to see light at the end of the tunnel.
I setup my cygwin/python env. per step 1 at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82826
Then I downloaded a clean version of 0.11.4
I then do a
$ ntpython setup.py build --compiler=mingw32
ntpython is what I renamed the Win32 python compiler per the above recipe.
--compiler=mingw32 tells python to compile for a pure win32 env.
I get compiler errors in cmodules.c, but the patch after my signature gets rid
of them.
Can you look at this and see if it is acceptable to you.
BTW: All my changes are inside of a #ifdef WIN32, so I believe no other
environment should be affected.
Greg
--
Greg Freemyer
=== Patch
$ diff -u rdiff-backup-0.11.4/cmodule.c rdiff-backup-0.11.4.gaf/cmodule.c
--- rdiff-backup-0.11.4/cmodule.c 2003-03-15 04:09:23.000000000 -0500
+++ rdiff-backup-0.11.4.gaf/cmodule.c 2003-03-18 19:02:51.000000000 -0500
@@ -32,6 +32,15 @@
# define STRUCT_STAT struct stat
#endif
+// Win32 definitions below. (NOT cygwin, only Win32)
+#ifdef WIN32
+#define false 0
+#define S_ISSOCK(x) (false) // NA for NTFS
+#define S_ISLNK(x) (false) // How do we identify a shortcut in
NTFS ?
+#define lstat(x,y) stat((x),(y)) // How do we stat a shortcut ?
+#define sync() (1) // How do we flush our buffers ?
+#endif
+
static PyObject *UnknownFileTypeError;
static PyObject *c_make_file_dict(PyObject *self, PyObject *args);
static PyObject *long2str(PyObject *self, PyObject *args);
@@ -125,6 +134,7 @@
"nlink", (long)
sbuf.st_nlink,
"linkname", lin
kname);
}
+#ifndef WIN32 // No character or block Special Devices via WIN32
} else if (S_ISCHR(mode) || S_ISBLK(mode)) {
/* Device files */
char devtype[2];
@@ -150,6 +160,7 @@
"devnums", Py_BuildVa
lue("(s,O,i)", devtype,
major_nu
m, minor_num));
Py_DECREF(major_num);
+#endif
} else {
/* Unrecognized file type - raise exception */
PyErr_SetString(UnknownFileTypeError, filename);
===
- [rdiff-backup-users] First Win32 patch,
Greg Freemyer <=