[dovecot-cvs] dovecot/src/lib compat.c,1.12,1.13 compat.h,1.20,1.21 mmap-util.c,1.10,1.11 mmap-util.h,1.4,1.5

cras at procontrol.fi cras at procontrol.fi
Fri Oct 3 18:50:50 EEST 2003


Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv20577

Modified Files:
	compat.c compat.h mmap-util.c mmap-util.h 
Log Message:
If we don't have function foo, do it always as #define foo my_foo and create
your own my_foo. Did this to pread/pwrite/madvise.



Index: compat.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/compat.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- compat.c	26 Aug 2003 21:18:16 -0000	1.12
+++ compat.c	3 Oct 2003 14:50:48 -0000	1.13
@@ -97,14 +97,14 @@
 #endif
 
 #ifndef HAVE_PWRITE
-ssize_t pread(int fd, void *buf, size_t count, off_t offset)
+ssize_t my_pread(int fd, void *buf, size_t count, off_t offset)
 {
 	if (lseek(fd, offset, SEEK_SET) < 0)
 		return -1;
 	return read(fd, buf, count);
 }
 
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
+ssize_t my_pwrite(int fd, const void *buf, size_t count, off_t offset)
 {
 	if (lseek(fd, offset, SEEK_SET) < 0)
 		return -1;

Index: compat.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/compat.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- compat.h	6 Aug 2003 19:46:51 -0000	1.20
+++ compat.h	3 Oct 2003 14:50:48 -0000	1.21
@@ -95,8 +95,10 @@
 #endif
 
 #ifndef HAVE_PWRITE
-ssize_t pread(int fd, void *buf, size_t count, off_t offset);
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
+#  define pread my_pread
+#  define pwrite my_pwrite
+ssize_t my_pread(int fd, void *buf, size_t count, off_t offset);
+ssize_t my_pwrite(int fd, const void *buf, size_t count, off_t offset);
 #endif
 
 /* ctype.h isn't safe with signed chars,

Index: mmap-util.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/mmap-util.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mmap-util.c	26 Aug 2003 21:18:16 -0000	1.10
+++ mmap-util.c	3 Oct 2003 14:50:48 -0000	1.11
@@ -38,8 +38,8 @@
 }
 
 #ifndef HAVE_MADVISE
-int madvise(void *start __attr_unused__, size_t length __attr_unused__,
-	    int advice __attr_unused__)
+int my_madvise(void *start __attr_unused__, size_t length __attr_unused__,
+	       int advice __attr_unused__)
 {
 }
 #endif

Index: mmap-util.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/mmap-util.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mmap-util.h	28 Oct 2002 09:00:25 -0000	1.4
+++ mmap-util.h	3 Oct 2003 14:50:48 -0000	1.5
@@ -15,7 +15,8 @@
 #endif
 
 #ifndef HAVE_MADVISE
-int madvise(void *start, size_t length, int advice);
+#  define madvise my_madvise
+int my_madvise(void *start, size_t length, int advice);
 #  ifndef MADV_NORMAL
 #    define MADV_NORMAL 0
 #    define MADV_RANDOM 0



More information about the dovecot-cvs mailing list