CVS update: /ccvs/windows-NT/

[email protected] 26 May 2005 08:40:49 -0000
Newsgroups gmane.comp.version-control.cvs.cvs
Message-ID <[email protected]>
User: conradpino
Date: 05/05/26 01:40:49

Modified:
 /ccvs/windows-NT/
  config.h.in.footer, config.h.in.in, unistd.h

Log:
 * config.h.in.footer: Reorganize into 3 sections (macros, typedefs and
 function prototypes) and alphabetize each section.  Synchronize with
 GNULib import so Windows build succeeds.
 * config.h.in.in: Synchronize with GNULib import so Windows build
 succeeds.
 * unistd.h: Include standard function prototypes from Microsoft files
 to decrease warnings in GNULib import.

File Changes:

Directory: /ccvs/windows-NT/
============================

File [changed]: config.h.in.footer
Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/config.h.in.footer?r1=1.4&r2=1.5
Delta lines:  +77 -46
---------------------
--- config.h.in.footer	1 Mar 2005 14:37:39 -0000	1.4
+++ config.h.in.footer	26 May 2005 08:40:47 -0000	1.5
@@ -7,58 +7,26 @@
    and use ../cvsnt.mak for your project.  Thus, this is the right place to
    put configuration information for Windows NT.  */
 
-/* Under Windows NT, mkdir only takes one argument.  */
-#define CVS_MKDIR wnt_mkdir
-int wnt_mkdir (const char *PATH, int MODE);
+/* This file is getting chaotic and will be organized as follows:
 
-#define CVS_STAT wnt_stat
-int wnt_stat ();
+		Macros appears first alphabetized in case sensitive order.
+		Typedefs appear next alphabetized in case sensitive order.
+		Function prototypes alphabetized in case sensitive order.
 
-#define CVS_LSTAT wnt_lstat
-int wnt_lstat ();
-
-#define CVS_RENAME wnt_rename
-int wnt_rename (const char *, const char *);
+	Reorgnized by Conrad T. Pino <[email protected]> May 25, 2005 */
 
-/* This function doesn't exist under Windows NT; we
-   provide a stub.  */
-int readlink (char *path, char *buf, int buf_size);
+/* ======================= Macro Definnitions Follow ====================== */
 
-/* This is just a call to GetCurrentProcessID.  */
-pid_t getpid (void);
-
-/* This is just a call to the Win32 Sleep function.  */
-unsigned int sleep (unsigned int);
-
-/* Don't worry, Microsoft, it's okay for these functions to
-   be in our namespace.  */
-#define popen _popen
-#define pclose _pclose
+/* Under Windows NT, mkdir only takes one argument.  */
+#define CVS_MKDIR wnt_mkdir
 
-/* Diff needs us to define this.  I think it could always be
-   -1 for CVS, because we pass temporary files to diff, but
-   config.h seems like the easiest place to put this, so for
-   now we put it here.  */
-#define same_file(s,t) (-1)
+#define CVS_RENAME wnt_rename
 
 /* This is where old bits go to die under Windows NT.  */
 #define DEVNULL "nul"
 
-#define START_SERVER wnt_start_server
-void wnt_start_server (int *tofd, int *fromfd,
-		       char *client_user,
-		       char *server_user,
-		       char *server_host,
-		       char *server_cvsroot);
-
-#define SHUTDOWN_SERVER wnt_shutdown_server
-void wnt_shutdown_server (int fd);
-
-#define SYSTEM_INITIALIZE(pargc,pargv) init_winsock()
-void init_winsock();
-
-#define SYSTEM_CLEANUP wnt_cleanup
-void wnt_cleanup (void);
+/* Windows has no ELOOP value in errno.h */
+#define ELOOP EMLINK
 
 #define HAVE_WINSOCK_H
 
@@ -67,6 +35,9 @@
    it because _open_osfhandle doesn't work.  */
 #define NO_SOCKET_TO_FD 1
 
+/* Stop server macro */
+#define SHUTDOWN_SERVER wnt_shutdown_server
+
 /* This tells the client that, in addition to needing to use
    send()/recv() to do socket I/O, the error codes for send()/recv()
    and other socket operations are not available through errno.
@@ -78,7 +49,9 @@
    and other socket operations are not known to strerror.  Instead,
    this macro should be used to convert the error codes to strings. */
 #define SOCK_STRERROR sock_strerror
-char *sock_strerror (int errnum);
+
+/* Start server macro */
+#define START_SERVER wnt_start_server
 
 /* The internal rsh client uses sockets not file descriptors.  Note
    that as the code stands now, it often takes values from a SOCKET and
@@ -86,12 +59,70 @@
    (SOCKET) <= sizeof (int) on win32, even the 64-bit variants.  */
 #define START_SERVER_RETURNS_SOCKET 1
 
+/* Macro name tells the story */
+#define SYSTEM_CLEANUP wnt_cleanup
+
+/* Macro name tells the story */
+#define SYSTEM_INITIALIZE(pargc,pargv) init_winsock()
+
 /* Is this true on NT?  Seems like I remember reports that NT 3.51 has
    problems with 200K writes (of course, the issue of large writes is
    moot since the use of buffer.c ensures that writes will only be as big
    as the buffers).  */
 #define SEND_NEVER_PARTIAL 1
 
-/* getpagesize is missing on Windows, but 4096 seems to do the right
-   thing. */
+/* Define POSIX name to Microsoft name */
+#define dup _dup
+
+/* getpagesize is missing on Windows, 4096 does the right thing. */
 #define getpagesize() 4096
+
+/* Define POSIX name to Microsoft name */
+#define popen _popen
+
+/* Define POSIX name to Microsoft name */
+#define pclose _pclose
+
+/* Diff needs us to define this.  I think it could always be
+   -1 for CVS, because we pass temporary files to diff, but
+   config.h seems like the easiest place to put this, so for
+   now we put it here.  */
+#define same_file(s,t) (-1)
+
+/* ====================== Typedef Declarations Follow ===================== */
+
+/* ====================== Function Prototypes Follow ====================== */
+
+/* This is just a call to GetCurrentProcessID.  */
+pid_t getpid (void);
+
+/* #define SYSTEM_INITIALIZE(pargc,pargv) init_winsock() */
+void init_winsock (void);
+
+/* #define SOCK_STRERROR sock_strerror */
+char *sock_strerror (int errnum);
+
+/* This is just a call to the Win32 Sleep function.  */
+unsigned int sleep (unsigned int);
+
+/* #define SYSTEM_CLEANUP wnt_cleanup */
+void wnt_cleanup (void);
+
+/* #define CVS_MKDIR wnt_mkdir */
+int wnt_mkdir (const char *PATH, int MODE);
+
+/* #define CVS_RENAME wnt_rename */
+int wnt_rename (const char *, const char *);
+
+/* #define SHUTDOWN_SERVER wnt_shutdown_server */
+void wnt_shutdown_server (int fd);
+
+/* #define START_SERVER wnt_start_server */
+void wnt_start_server (int *tofd, int *fromfd,
+		       char *client_user,
+		       char *server_user,
+		       char *server_host,
+		       char *server_cvsroot);
+
+/* #define stat wnt_stat and #define lstat wnt_stat */
+int wnt_stat (const char *file, struct wnt_stat *sb);

File [changed]: config.h.in.in
Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/config.h.in.in?r1=1.32&r2=1.33
Delta lines:  +56 -3
--------------------
--- config.h.in.in	25 May 2005 20:54:40 -0000	1.32
+++ config.h.in.in	26 May 2005 08:40:47 -0000	1.33
@@ -92,8 +92,9 @@
    message to be appended to the temp file when the editor is started. */
 #undef FORCE_USE_EDITOR
 
-/* Define if gettimeofday clobbers localtime's static buffer. */
-#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER
+/* Define to rpl_ if the glob replacement functions and variables should be
+   used. */
+#define GLOB_PREFIX rpl_
 
 /* Define to an alternative value if GSS_C_NT_HOSTBASED_SERVICE isn't defined
    in the gssapi.h header file. MIT Kerberos 1.2.1 requires this. Only
@@ -117,6 +118,9 @@
 /* Define to 1 if you have the `btowc' function. */
 #undef HAVE_BTOWC
 
+/* Define to 1 if you have the `canonicalize_file_name' function. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
 /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
    CoreFoundation framework. */
 #undef HAVE_CFLOCALECOPYCURRENT
@@ -208,6 +212,14 @@
    */
 #undef HAVE_DECL_GETENV
 
+/* Define to 1 if you have the declaration of `getlogin', and to 0 if you
+   don't. */
+#undef HAVE_DECL_GETLOGIN
+
+/* Define to 1 if you have the declaration of `getlogin_r', and to 0 if you
+   don't. */
+#undef HAVE_DECL_GETLOGIN_R
+
 /* Define to 1 if you have the declaration of `getpass', and to 0 if you
    don't. */
 #define HAVE_DECL_GETPASS 0
@@ -228,6 +240,10 @@
    don't. */
 #undef HAVE_DECL_PUTC_UNLOCKED
 
+/* Define to 1 if you have the declaration of `strdup', and to 0 if you don't.
+   */
+#define HAVE_DECL_STRDUP 1
+
 /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
    don't. */
 #undef HAVE_DECL_STRERROR_R
@@ -284,6 +300,9 @@
 /* Define to 1 if you have the `gethostname' function. */
 #undef HAVE_GETHOSTNAME
 
+/* Define to 1 if you have the `getlogin_r' function. */
+#undef HAVE_GETLOGIN_R
+
 /* Define to 1 if you have the <getopt.h> header file. */
 #undef HAVE_GETOPT_H
 
@@ -293,6 +312,9 @@
 /* Define to 1 if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
+/* Define to 1 if you have the `getpwnam_r' function. */
+#undef HAVE_GETPWNAM_R
+
 /* Define if you have the getspnam function. */
 #undef HAVE_GETSPNAM
 
@@ -302,6 +324,9 @@
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
+/* Define to 1 if you have the <glob.h> header file. */
+#define HAVE_GLOB_H 1
+
 /* Define if you have GSSAPI with Kerberos version 5 available. */
 #undef HAVE_GSSAPI
 
@@ -423,6 +448,12 @@
 /* Define to 1 if you have the `memrchr' function. */
 #undef HAVE_MEMRCHR
 
+/* Define to 1 if <limits.h> defines the MIN and MAX macros. */
+#define HAVE_MINMAX_IN_LIMITS_H 1
+
+/* Define to 1 if <sys/param.h> defines the MIN and MAX macros. */
+#undef HAVE_MINMAX_IN_SYS_PARAM_H
+
 /* Define to 1 if you have the `mknod' function. */
 #undef HAVE_MKNOD
 
@@ -493,6 +524,9 @@
 /* Define to 1 if you have the `regfree' function. */
 #undef HAVE_REGFREE
 
+/* Define to 1 if you have the `resolvepath' function. */
+#undef HAVE_RESOLVEPATH
+
 /* Define to 1 if you have the `rpmatch' function. */
 #undef HAVE_RPMATCH
 
@@ -517,6 +551,9 @@
 /* Define to 1 if you have the `sigblock' function. */
 #undef HAVE_SIGBLOCK
 
+/* Define to 1 if you have the `siginterrupt' function. */
+#undef HAVE_SIGINTERRUPT
+
 /* Define to 1 if you have the `sigprocmask' function. */
 #undef HAVE_SIGPROCMASK
 
@@ -555,8 +592,11 @@
 /* Define if you have strchr (always for CVS). */
 #undef HAVE_STRCHR
 
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
 /* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
+#define HAVE_STRERROR 1
 
 /* Define to 1 if you have the `strerror_r' function. */
 #undef HAVE_STRERROR_R
@@ -582,6 +622,10 @@
 /* Define to 1 if you have the `strtoul' function. */
 #undef HAVE_STRTOUL
 
+/* Define if there is a member named d_type in the struct describing directory
+   headers. */
+#undef HAVE_STRUCT_DIRENT_D_TYPE
+
 /* Define to 1 if `st_blksize' is member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_BLKSIZE
 
@@ -600,6 +644,9 @@
 /* Define to 1 if you have the <sys/bsdtypes.h> header file. */
 #undef HAVE_SYS_BSDTYPES_H
 
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+#undef HAVE_SYS_CDEFS_H
+
 /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
    */
 #undef HAVE_SYS_DIR_H
@@ -1089,6 +1136,9 @@
 /* Define to rpl_localtime if the replacement function should be used. */
 #undef localtime
 
+/* Define to a substitute for the `lstat' function. */
+#define lstat stat
+
 /* Define to rpl_malloc if the replacement function should be used. */
 #undef malloc
 
@@ -1138,6 +1188,9 @@
 /* Define as a signed type of the same size as size_t. */
 #define ssize_t int
 
+/* Define to a substitute for the stat function. */
+#define stat wnt_stat
+
 /* Define to rpl_tzset if the wrapper function should be used. */
 #undef tzset
 

File [changed]: unistd.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/unistd.h?r1=1.4&r2=1.5
Delta lines:  +10 -2
--------------------
--- unistd.h	30 Nov 2004 07:57:12 -0000	1.4
+++ unistd.h	26 May 2005 08:40:47 -0000	1.5
@@ -21,8 +21,14 @@
 #ifndef UNISTD_H
 #define UNISTD_H
 
-int chdir (const char *path);
-int close (int fd);
+/* include Microsoft's chdir, getcwd */
+#include <direct.h>
+
+/* include Microsoft's close, dup */
+#include <io.h>
+
+/* This function doesn't exist under Windows NT; we provide a stub */
+int readlink (const char *path, char *buf, size_t buf_size);
 
 /*
 FIXME:	gethostname prototype for lib/xgethostname.c, no #include <winsock.h>
@@ -33,6 +39,7 @@
 
 #if 0 /* someday maybe these should be added here as well */
 
+int chdir (const char *pathname);
 int mkdir (const char *pathname, mode_t mode);
 int rmdir (const char *pathname);
 int link (const char *oldpath, const char *newpath);
@@ -49,6 +56,7 @@
 int access (const char *pathname, int mode);
 int open (const char *pathname, int flags);
 int creat (const char *pathname, mode_t mode);
+int close (int fd);
 ssize_t read (int fd, void *buf, size_t count);
 ssize_t write (int fd, const void *buf, size_t count);
 int fcntl (int fd, int cmd);