From e7a780ec4dda5bd8e194cd916e43433d646c1265 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 7 May 2015 10:45:28 +0100 Subject: [PATCH] ITS#8127 fix ftello for Win32 --- servers/slapd/slapadd.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/servers/slapd/slapadd.c b/servers/slapd/slapadd.c index 8cfdebdaa8..d89d2eff2a 100644 --- a/servers/slapd/slapadd.c +++ b/servers/slapd/slapadd.c @@ -40,6 +40,20 @@ #include "slapcommon.h" +#ifdef _WIN32 +# ifdef __WIN64__ +# define ftello(fp) _ftelli64(fp) +# else +/* Ideally we would use _ftelli64 but that was only available + * starting in MSVCR80.DLL. The approach used here is inaccurate + * because returning the underlying file handle's file pointer + * doesn't take the stdio buffer offset into account. But, it + * works with all versions of MSVCRT. + */ +# define ftello(fp) _telli64(fileno(fp)) +# endif +#endif + extern int slap_DN_strict; /* dn.c */ static char csnbuf[ LDAP_PVT_CSNSTR_BUFSIZE ]; -- 2.39.5