]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Cleanup Windows build
authorHoward Chu <hyc@openldap.org>
Thu, 7 Sep 2023 19:03:07 +0000 (20:03 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 11 Jan 2024 17:53:43 +0000 (17:53 +0000)
Fix make depend errors in slapi

servers/slapd/slapi/Makefile.in
servers/slapd/slapi/printmsg.c
servers/slapd/slapi/slapi_utils.c

index 0e46f786412f74508588c4e6471e9ac6f816c235..32ade0cc26f049a88275c6d04803d1edb80fb0d0 100644 (file)
@@ -19,9 +19,6 @@ LIBRARY = libslapi.la
 #all-common: $(LIBRARY) $(PROGRAMS)
 #      @touch plugin.c slapi_pblock.c slapi_utils.c slapi_ops.c slapi_ext.c
 
-NT_SRCS = nt_err.c
-NT_OBJS = nt_err.lo
-
 LIB_DEFS = -DSLAPI_LIBRARY
 
 SRCS=  plugin.c slapi_pblock.c slapi_utils.c printmsg.c slapi_ops.c slapi_dn.c slapi_ext.c slapi_overlay.c \
@@ -31,12 +28,15 @@ OBJS=  plugin.lo slapi_pblock.lo slapi_utils.lo printmsg.lo slapi_ops.lo slapi_d
 
 XSRCS= version.c
 
-LDAP_INCDIR= ../../../include -I.. -I.       
-LDAP_LIBDIR= ../../../libraries       
+LDAP_INCDIR= ../../../include -I.. -I.
+LDAP_LIBDIR= ../../../libraries
+
+shared_LDAP_LIBS = $(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
 
 XLIBS = $(LIBRARY)
 XXLIBS = 
-NT_LINK_LIBS = $(AC_LIBS)
+MOD_LIBS = $(MODULES_LIBS)
+NT_LINK_LIBS = $(AC_LIBS) -L.. -lslapd $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
 
 XINCPATH = -I$(srcdir)/.. -I$(srcdir)
 XDEFS = $(MODULES_CPPFLAGS)
index 15b60045ed8c4936cbdd853d5f4a3877ef0367ff..5251846f211d94fa4f83f1fcf3248133cdcce65f 100644 (file)
 #include <slap.h>
 #include <slapi.h>
 
+#ifdef _WIN32
+#include <io.h>
+#endif
+
 #include <ldap_pvt_thread.h>
 
 /* Single threads access to routine */
@@ -60,18 +64,30 @@ slapi_int_log_error(
 
        /* for now, we log all severities */
        if ( level <= slapi_log_level ) {
+#ifdef _WIN32
+               intptr_t fhandle;
+#endif
                fp = fopen( slapi_log_file, "a" );
                if ( fp == NULL) {
                        rc = -1;
                        goto done;
                }
 
+#ifdef _WIN32
+               fhandle = _get_osfhandle( fileno( fp ));
+#endif
                /*
                 * FIXME: could block
                 */
+#ifdef _WIN32
+               while ( LockFile( fhandle, 0, 0, UINT_MAX, UINT_MAX ) == 0 ) {
+                       /* DO NOTHING */ ;
+               }
+#else
                while ( lockf( fileno( fp ), F_LOCK, 0 ) != 0 ) {
                        /* DO NOTHING */ ;
                }
+#endif
 
                time( &currentTime );
                ltm = localtime( &currentTime );
@@ -85,7 +101,11 @@ slapi_int_log_error(
                }
                fflush( fp );
 
+#ifdef _WIN32
+               UnlockFile( fhandle, 0, 0, UINT_MAX, UINT_MAX );
+#else
                lockf( fileno( fp ), F_ULOCK, 0 );
+#endif
 
                fclose( fp );
 
index 6c1cecfc27902001380b68a58cf71ddb5c05f21d..c45912213f55ff0ee7ab27dd8a0115da61bf57cb 100644 (file)
 #include <slap.h>
 #include <slapi.h>
 
+#ifdef _WIN32
+#include <winsock.h>
+#else
 #include <netdb.h>
+#endif
 
 #ifdef LDAP_SLAPI
 
@@ -1971,6 +1975,8 @@ slapi_timer_current_time( void )
         */
 #else /* _WIN32 */
        LARGE_INTEGER now;
+       static LARGE_INTEGER base_time, performance_freq;
+       static int performance_counter_present;
 
        if ( first_time ) {
                first_time = 0;