Skip to content

Commit df08e6a

Browse files
committed
Port mode_t (and gid_t, uid_t) to MS-Windows
Problem reported by Manuela Friedrich in: * zic.c (gid_t, mode_t, uid_t) [HAVE_DIRECT_H]: New typedefs. (gid_t, mode_t, uid_t): Remove these macros.
1 parent 6127d37 commit df08e6a

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ LDLIBS=
269269
# variables like 'tzname' required by POSIX
270270
# -DHAVE_PWD_H=0 if your system lacks pwd.h, grp.h and corresponding functions
271271
# The following additional options may be needed:
272-
# -Dgid_t=T, -Duid_t=T to define gid_t, uid_t to be type T (default int)
272+
# -Dgid_t=T, -Duid_t=T to define gid_t, uid_t to be type T
273273
# -DHAVE_SETENV=0 if your system lacks the setenv function
274274
# -DHAVE_SETMODE=[01] if your system lacks or has the setmode and getmode
275275
# functions (default is guessed)
@@ -286,7 +286,7 @@ LDLIBS=
286286
# -DHAVE_SYMLINK=0 if your system lacks the symlink function
287287
# -DHAVE_SYS_STAT_H=0 if <sys/stat.h> does not work*
288288
# The following additional option may be needed:
289-
# -Dmode_t=T to define mode_t to be type T (default int)
289+
# -Dmode_t=T to define mode_t to be type T
290290
# -DHAVE_TZSET=0 if your system lacks a tzset function
291291
# -DHAVE_UNISTD_H=0 if <unistd.h> does not work*
292292
# -DHAVE_UTMPX_H=0 if <utmpx.h> does not work*

zic.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ enum { FORMAT_LEN_GROWTH_BOUND = 5 };
4949
# include <direct.h>
5050
# include <io.h>
5151
# define mkdir(name, mode) _mkdir(name)
52+
typedef unsigned short gid_t, mode_t, uid_t;
5253
#endif
5354

5455
#ifndef HAVE_GETRANDOM
@@ -67,10 +68,6 @@ enum { FORMAT_LEN_GROWTH_BOUND = 5 };
6768

6869
#if HAVE_SYS_STAT_H
6970
# include <sys/stat.h>
70-
#else
71-
# ifndef mode_t
72-
# define mode_t int
73-
# endif
7471
#endif
7572

7673
#ifndef S_IRWXU
@@ -119,12 +116,6 @@ static mode_t creat_perms = CREAT_PERMS;
119116
# include <grp.h>
120117
# include <pwd.h>
121118
#else
122-
# ifndef gid_t
123-
# define gid_t int
124-
# endif
125-
# ifndef uid_t
126-
# define uid_t int
127-
# endif
128119
struct group { gid_t gr_gid; };
129120
struct passwd { uid_t pw_uid; };
130121
# define getgrnam(arg) NULL

0 commit comments

Comments
 (0)