libphobos: Backport extern(C) bindings from druntime 2.085.
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 26 Mar 2019 15:18:19 +0000 (15:18 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Tue, 26 Mar 2019 15:18:19 +0000 (15:18 +0000)
Merges upstream druntime b9564bef.

Reviewed-on: https://github.com/dlang/druntime/pull/2512

libphobos/ChangeLog:

2019-03-26  Iain Buclaw  <ibuclaw@gdcproject.org>

* libdruntime/Makefile.am (DRUNTIME_DSOURCES_DARWIN): Add
core/sys/darwin/crt_externs.d.
(DRUNTIME_DSOURCES_FREEBSD): Add core/sys/freebsd/unistd.d.
(DRUNTIME_DSOURCES_POSIX): Add core/sys/posix/spawn.d.
* libdruntime/Makefile.in: Regenerate.

From-SVN: r269948

99 files changed:
libphobos/ChangeLog
libphobos/libdruntime/MERGE
libphobos/libdruntime/Makefile.am
libphobos/libdruntime/Makefile.in
libphobos/libdruntime/core/stdc/errno.d
libphobos/libdruntime/core/stdc/fenv.d
libphobos/libdruntime/core/stdc/stdio.d
libphobos/libdruntime/core/stdc/wchar_.d
libphobos/libdruntime/core/sync/mutex.d
libphobos/libdruntime/core/sys/darwin/crt_externs.d [new file with mode: 0644]
libphobos/libdruntime/core/sys/darwin/mach/getsect.d
libphobos/libdruntime/core/sys/darwin/mach/loader.d
libphobos/libdruntime/core/sys/darwin/netinet/in_.d
libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d
libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d
libphobos/libdruntime/core/sys/freebsd/pthread_np.d
libphobos/libdruntime/core/sys/freebsd/sys/elf32.d
libphobos/libdruntime/core/sys/freebsd/sys/elf64.d
libphobos/libdruntime/core/sys/freebsd/sys/mount.d
libphobos/libdruntime/core/sys/freebsd/unistd.d [new file with mode: 0644]
libphobos/libdruntime/core/sys/linux/elf.d
libphobos/libdruntime/core/sys/linux/epoll.d
libphobos/libdruntime/core/sys/linux/netinet/in_.d
libphobos/libdruntime/core/sys/linux/sched.d
libphobos/libdruntime/core/sys/linux/sys/eventfd.d
libphobos/libdruntime/core/sys/netbsd/sys/elf32.d
libphobos/libdruntime/core/sys/netbsd/sys/elf64.d
libphobos/libdruntime/core/sys/posix/aio.d
libphobos/libdruntime/core/sys/posix/config.d
libphobos/libdruntime/core/sys/posix/dirent.d
libphobos/libdruntime/core/sys/posix/fcntl.d
libphobos/libdruntime/core/sys/posix/setjmp.d
libphobos/libdruntime/core/sys/posix/signal.d
libphobos/libdruntime/core/sys/posix/spawn.d [new file with mode: 0644]
libphobos/libdruntime/core/sys/posix/sys/ipc.d
libphobos/libdruntime/core/sys/posix/sys/mman.d
libphobos/libdruntime/core/sys/posix/sys/msg.d
libphobos/libdruntime/core/sys/posix/sys/resource.d
libphobos/libdruntime/core/sys/posix/sys/socket.d
libphobos/libdruntime/core/sys/posix/sys/stat.d
libphobos/libdruntime/core/sys/posix/sys/statvfs.d
libphobos/libdruntime/core/sys/posix/sys/types.d
libphobos/libdruntime/core/sys/posix/sys/utsname.d
libphobos/libdruntime/core/sys/posix/ucontext.d
libphobos/libdruntime/core/sys/solaris/sys/elf.d
libphobos/libdruntime/core/sys/solaris/sys/priocntl.d
libphobos/libdruntime/core/sys/windows/aclapi.d
libphobos/libdruntime/core/sys/windows/com.d
libphobos/libdruntime/core/sys/windows/comcat.d
libphobos/libdruntime/core/sys/windows/commctrl.d
libphobos/libdruntime/core/sys/windows/cpl.d
libphobos/libdruntime/core/sys/windows/custcntl.d
libphobos/libdruntime/core/sys/windows/dbghelp.d
libphobos/libdruntime/core/sys/windows/dbghelp_types.d
libphobos/libdruntime/core/sys/windows/dbt.d
libphobos/libdruntime/core/sys/windows/ddeml.d
libphobos/libdruntime/core/sys/windows/dll.d
libphobos/libdruntime/core/sys/windows/docobj.d
libphobos/libdruntime/core/sys/windows/httpext.d
libphobos/libdruntime/core/sys/windows/imagehlp.d
libphobos/libdruntime/core/sys/windows/imm.d
libphobos/libdruntime/core/sys/windows/ipexport.d
libphobos/libdruntime/core/sys/windows/iprtrmib.d
libphobos/libdruntime/core/sys/windows/iptypes.d
libphobos/libdruntime/core/sys/windows/lmalert.d
libphobos/libdruntime/core/sys/windows/mapi.d
libphobos/libdruntime/core/sys/windows/mmsystem.d
libphobos/libdruntime/core/sys/windows/msacm.d
libphobos/libdruntime/core/sys/windows/objidl.d
libphobos/libdruntime/core/sys/windows/oledlg.d
libphobos/libdruntime/core/sys/windows/ras.d
libphobos/libdruntime/core/sys/windows/rasdlg.d
libphobos/libdruntime/core/sys/windows/rassapi.d
libphobos/libdruntime/core/sys/windows/richedit.d
libphobos/libdruntime/core/sys/windows/setupapi.d
libphobos/libdruntime/core/sys/windows/shellapi.d
libphobos/libdruntime/core/sys/windows/shlobj.d
libphobos/libdruntime/core/sys/windows/snmp.d
libphobos/libdruntime/core/sys/windows/stacktrace.d
libphobos/libdruntime/core/sys/windows/subauth.d
libphobos/libdruntime/core/sys/windows/threadaux.d
libphobos/libdruntime/core/sys/windows/tlhelp32.d
libphobos/libdruntime/core/sys/windows/vfw.d
libphobos/libdruntime/core/sys/windows/winbase.d
libphobos/libdruntime/core/sys/windows/wincon.d
libphobos/libdruntime/core/sys/windows/wincrypt.d
libphobos/libdruntime/core/sys/windows/wingdi.d
libphobos/libdruntime/core/sys/windows/wininet.d
libphobos/libdruntime/core/sys/windows/winioctl.d
libphobos/libdruntime/core/sys/windows/winnetwk.d
libphobos/libdruntime/core/sys/windows/winnls.d
libphobos/libdruntime/core/sys/windows/winnt.d
libphobos/libdruntime/core/sys/windows/winperf.d
libphobos/libdruntime/core/sys/windows/winsock2.d
libphobos/libdruntime/core/sys/windows/winuser.d
libphobos/libdruntime/core/sys/windows/wtsapi32.d
libphobos/libdruntime/rt/util/container/array.d
libphobos/libdruntime/rt/util/container/common.d
libphobos/libdruntime/rt/util/container/hashtab.d

index 13b93352918e73972d737dcad1cfc2d027340d0b..1b968177e4013735f6f637b417f2be8729c379b0 100644 (file)
@@ -1,3 +1,11 @@
+2019-03-26  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       * libdruntime/Makefile.am (DRUNTIME_DSOURCES_DARWIN): Add
+       core/sys/darwin/crt_externs.d.
+       (DRUNTIME_DSOURCES_FREEBSD): Add core/sys/freebsd/unistd.d.
+       (DRUNTIME_DSOURCES_POSIX): Add core/sys/posix/spawn.d.
+       * libdruntime/Makefile.in: Regenerate.
+
 2019-03-23  Johannes Pfau  <johannespfau@gmail.com>
 
        * configure.ac: Update autotool version comment.
index 1a09ebf54109833ac9a8142fe7bc2303c104fde4..ed756fa6c1855d29853d56365c720a3de4da9684 100644 (file)
@@ -1,4 +1,4 @@
-bbfb58e8a921cabdd0002a40bf63fe35ed7c77e8
+b9564bef1147c797842e6c1a804f2c3565c64ac1
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/druntime repository.
index 3085bfb181a49ad06bf85c563ee669dec9f78bef..53d03b1e82ab648b237e0fdd2673a6f34118edf9 100644 (file)
@@ -220,14 +220,14 @@ DRUNTIME_DSOURCES_GCSTUB = gcstub/gc.d
 DRUNTIME_DSOURCES_BIONIC = core/sys/bionic/fcntl.d \
        core/sys/bionic/unistd.d
 
-DRUNTIME_DSOURCES_DARWIN = core/sys/darwin/dlfcn.d \
-       core/sys/darwin/execinfo.d core/sys/darwin/mach/dyld.d \
-       core/sys/darwin/mach/getsect.d core/sys/darwin/mach/kern_return.d \
-       core/sys/darwin/mach/loader.d core/sys/darwin/mach/port.d \
-       core/sys/darwin/mach/semaphore.d core/sys/darwin/mach/thread_act.d \
-       core/sys/darwin/netinet/in_.d core/sys/darwin/pthread.d \
-       core/sys/darwin/sys/cdefs.d core/sys/darwin/sys/event.d \
-       core/sys/darwin/sys/mman.d
+DRUNTIME_DSOURCES_DARWIN = core/sys/darwin/crt_externs.d \
+       core/sys/darwin/dlfcn.d core/sys/darwin/execinfo.d \
+       core/sys/darwin/mach/dyld.d core/sys/darwin/mach/getsect.d \
+       core/sys/darwin/mach/kern_return.d core/sys/darwin/mach/loader.d \
+       core/sys/darwin/mach/port.d core/sys/darwin/mach/semaphore.d \
+       core/sys/darwin/mach/thread_act.d core/sys/darwin/netinet/in_.d \
+       core/sys/darwin/pthread.d core/sys/darwin/sys/cdefs.d \
+       core/sys/darwin/sys/event.d core/sys/darwin/sys/mman.d
 
 DRUNTIME_DSOURCES_DRAGONFLYBSD = core/sys/dragonflybsd/dlfcn.d \
        core/sys/dragonflybsd/execinfo.d core/sys/dragonflybsd/netinet/in_.d \
@@ -247,7 +247,7 @@ DRUNTIME_DSOURCES_FREEBSD = core/sys/freebsd/dlfcn.d \
        core/sys/freebsd/sys/elf64.d core/sys/freebsd/sys/elf_common.d \
        core/sys/freebsd/sys/event.d core/sys/freebsd/sys/link_elf.d \
        core/sys/freebsd/sys/mman.d core/sys/freebsd/sys/mount.d \
-       core/sys/freebsd/time.d
+       core/sys/freebsd/time.d core/sys/freebsd/unistd.d
 
 DRUNTIME_DSOURCES_LINUX = core/sys/linux/config.d \
        core/sys/linux/dlfcn.d core/sys/linux/elf.d core/sys/linux/epoll.d \
@@ -282,18 +282,19 @@ DRUNTIME_DSOURCES_POSIX = core/sys/posix/aio.d \
        core/sys/posix/netinet/in_.d core/sys/posix/netinet/tcp.d \
        core/sys/posix/poll.d core/sys/posix/pthread.d core/sys/posix/pwd.d \
        core/sys/posix/sched.d core/sys/posix/semaphore.d \
-       core/sys/posix/setjmp.d core/sys/posix/signal.d core/sys/posix/stdio.d \
-       core/sys/posix/stdlib.d core/sys/posix/sys/filio.d \
-       core/sys/posix/sys/ioccom.d core/sys/posix/sys/ioctl.d \
-       core/sys/posix/sys/ipc.d core/sys/posix/sys/mman.d \
-       core/sys/posix/sys/msg.d core/sys/posix/sys/resource.d \
-       core/sys/posix/sys/select.d core/sys/posix/sys/shm.d \
-       core/sys/posix/sys/socket.d core/sys/posix/sys/stat.d \
-       core/sys/posix/sys/statvfs.d core/sys/posix/sys/time.d \
-       core/sys/posix/sys/ttycom.d core/sys/posix/sys/types.d \
-       core/sys/posix/sys/uio.d core/sys/posix/sys/un.d \
-       core/sys/posix/sys/utsname.d core/sys/posix/sys/wait.d \
-       core/sys/posix/syslog.d core/sys/posix/termios.d core/sys/posix/time.d \
+       core/sys/posix/setjmp.d core/sys/posix/signal.d core/sys/posix/spawn.d \
+       core/sys/posix/stdio.d core/sys/posix/stdlib.d \
+       core/sys/posix/sys/filio.d core/sys/posix/sys/ioccom.d \
+       core/sys/posix/sys/ioctl.d core/sys/posix/sys/ipc.d \
+       core/sys/posix/sys/mman.d core/sys/posix/sys/msg.d \
+       core/sys/posix/sys/resource.d core/sys/posix/sys/select.d \
+       core/sys/posix/sys/shm.d core/sys/posix/sys/socket.d \
+       core/sys/posix/sys/stat.d core/sys/posix/sys/statvfs.d \
+       core/sys/posix/sys/time.d core/sys/posix/sys/ttycom.d \
+       core/sys/posix/sys/types.d core/sys/posix/sys/uio.d \
+       core/sys/posix/sys/un.d core/sys/posix/sys/utsname.d \
+       core/sys/posix/sys/wait.d core/sys/posix/syslog.d \
+       core/sys/posix/termios.d core/sys/posix/time.d \
        core/sys/posix/ucontext.d core/sys/posix/unistd.d \
        core/sys/posix/utime.d
 
index 509109b9a71c801651b6b2bfc26c148604accc88..100312ebf2df51930843001cff375ad404e411c0 100644 (file)
@@ -247,22 +247,23 @@ am__objects_6 = core/sys/posix/aio.lo core/sys/posix/arpa/inet.lo \
        core/sys/posix/pthread.lo core/sys/posix/pwd.lo \
        core/sys/posix/sched.lo core/sys/posix/semaphore.lo \
        core/sys/posix/setjmp.lo core/sys/posix/signal.lo \
-       core/sys/posix/stdio.lo core/sys/posix/stdlib.lo \
-       core/sys/posix/sys/filio.lo core/sys/posix/sys/ioccom.lo \
-       core/sys/posix/sys/ioctl.lo core/sys/posix/sys/ipc.lo \
-       core/sys/posix/sys/mman.lo core/sys/posix/sys/msg.lo \
-       core/sys/posix/sys/resource.lo core/sys/posix/sys/select.lo \
-       core/sys/posix/sys/shm.lo core/sys/posix/sys/socket.lo \
-       core/sys/posix/sys/stat.lo core/sys/posix/sys/statvfs.lo \
-       core/sys/posix/sys/time.lo core/sys/posix/sys/ttycom.lo \
-       core/sys/posix/sys/types.lo core/sys/posix/sys/uio.lo \
-       core/sys/posix/sys/un.lo core/sys/posix/sys/utsname.lo \
-       core/sys/posix/sys/wait.lo core/sys/posix/syslog.lo \
-       core/sys/posix/termios.lo core/sys/posix/time.lo \
-       core/sys/posix/ucontext.lo core/sys/posix/unistd.lo \
-       core/sys/posix/utime.lo
+       core/sys/posix/spawn.lo core/sys/posix/stdio.lo \
+       core/sys/posix/stdlib.lo core/sys/posix/sys/filio.lo \
+       core/sys/posix/sys/ioccom.lo core/sys/posix/sys/ioctl.lo \
+       core/sys/posix/sys/ipc.lo core/sys/posix/sys/mman.lo \
+       core/sys/posix/sys/msg.lo core/sys/posix/sys/resource.lo \
+       core/sys/posix/sys/select.lo core/sys/posix/sys/shm.lo \
+       core/sys/posix/sys/socket.lo core/sys/posix/sys/stat.lo \
+       core/sys/posix/sys/statvfs.lo core/sys/posix/sys/time.lo \
+       core/sys/posix/sys/ttycom.lo core/sys/posix/sys/types.lo \
+       core/sys/posix/sys/uio.lo core/sys/posix/sys/un.lo \
+       core/sys/posix/sys/utsname.lo core/sys/posix/sys/wait.lo \
+       core/sys/posix/syslog.lo core/sys/posix/termios.lo \
+       core/sys/posix/time.lo core/sys/posix/ucontext.lo \
+       core/sys/posix/unistd.lo core/sys/posix/utime.lo
 @DRUNTIME_OS_UNIX_TRUE@am__objects_7 = $(am__objects_6)
-am__objects_8 = core/sys/darwin/dlfcn.lo core/sys/darwin/execinfo.lo \
+am__objects_8 = core/sys/darwin/crt_externs.lo \
+       core/sys/darwin/dlfcn.lo core/sys/darwin/execinfo.lo \
        core/sys/darwin/mach/dyld.lo core/sys/darwin/mach/getsect.lo \
        core/sys/darwin/mach/kern_return.lo \
        core/sys/darwin/mach/loader.lo core/sys/darwin/mach/port.lo \
@@ -299,7 +300,7 @@ am__objects_14 = core/sys/freebsd/dlfcn.lo \
        core/sys/freebsd/sys/elf_common.lo \
        core/sys/freebsd/sys/event.lo core/sys/freebsd/sys/link_elf.lo \
        core/sys/freebsd/sys/mman.lo core/sys/freebsd/sys/mount.lo \
-       core/sys/freebsd/time.lo
+       core/sys/freebsd/time.lo core/sys/freebsd/unistd.lo
 @DRUNTIME_OS_FREEBSD_TRUE@am__objects_15 = $(am__objects_14)
 am__objects_16 = core/sys/netbsd/dlfcn.lo core/sys/netbsd/execinfo.lo \
        core/sys/netbsd/sys/elf.lo core/sys/netbsd/sys/elf32.lo \
@@ -509,11 +510,11 @@ am__DEPENDENCIES_7 = core/sys/posix/aio.t.lo \
        core/sys/posix/pthread.t.lo core/sys/posix/pwd.t.lo \
        core/sys/posix/sched.t.lo core/sys/posix/semaphore.t.lo \
        core/sys/posix/setjmp.t.lo core/sys/posix/signal.t.lo \
-       core/sys/posix/stdio.t.lo core/sys/posix/stdlib.t.lo \
-       core/sys/posix/sys/filio.t.lo core/sys/posix/sys/ioccom.t.lo \
-       core/sys/posix/sys/ioctl.t.lo core/sys/posix/sys/ipc.t.lo \
-       core/sys/posix/sys/mman.t.lo core/sys/posix/sys/msg.t.lo \
-       core/sys/posix/sys/resource.t.lo \
+       core/sys/posix/spawn.t.lo core/sys/posix/stdio.t.lo \
+       core/sys/posix/stdlib.t.lo core/sys/posix/sys/filio.t.lo \
+       core/sys/posix/sys/ioccom.t.lo core/sys/posix/sys/ioctl.t.lo \
+       core/sys/posix/sys/ipc.t.lo core/sys/posix/sys/mman.t.lo \
+       core/sys/posix/sys/msg.t.lo core/sys/posix/sys/resource.t.lo \
        core/sys/posix/sys/select.t.lo core/sys/posix/sys/shm.t.lo \
        core/sys/posix/sys/socket.t.lo core/sys/posix/sys/stat.t.lo \
        core/sys/posix/sys/statvfs.t.lo core/sys/posix/sys/time.t.lo \
@@ -524,8 +525,9 @@ am__DEPENDENCIES_7 = core/sys/posix/aio.t.lo \
        core/sys/posix/time.t.lo core/sys/posix/ucontext.t.lo \
        core/sys/posix/unistd.t.lo core/sys/posix/utime.t.lo
 @DRUNTIME_OS_UNIX_TRUE@am__DEPENDENCIES_8 = $(am__DEPENDENCIES_7)
-am__DEPENDENCIES_9 = core/sys/darwin/dlfcn.t.lo \
-       core/sys/darwin/execinfo.t.lo core/sys/darwin/mach/dyld.t.lo \
+am__DEPENDENCIES_9 = core/sys/darwin/crt_externs.t.lo \
+       core/sys/darwin/dlfcn.t.lo core/sys/darwin/execinfo.t.lo \
+       core/sys/darwin/mach/dyld.t.lo \
        core/sys/darwin/mach/getsect.t.lo \
        core/sys/darwin/mach/kern_return.t.lo \
        core/sys/darwin/mach/loader.t.lo \
@@ -570,7 +572,7 @@ am__DEPENDENCIES_15 = core/sys/freebsd/dlfcn.t.lo \
        core/sys/freebsd/sys/event.t.lo \
        core/sys/freebsd/sys/link_elf.t.lo \
        core/sys/freebsd/sys/mman.t.lo core/sys/freebsd/sys/mount.t.lo \
-       core/sys/freebsd/time.t.lo
+       core/sys/freebsd/time.t.lo core/sys/freebsd/unistd.t.lo
 @DRUNTIME_OS_FREEBSD_TRUE@am__DEPENDENCIES_16 =  \
 @DRUNTIME_OS_FREEBSD_TRUE@     $(am__DEPENDENCIES_15)
 am__DEPENDENCIES_17 = core/sys/netbsd/dlfcn.t.lo \
@@ -801,24 +803,25 @@ am__DEPENDENCIES_35 = core/sys/posix/aio.t.o \
        core/sys/posix/poll.t.o core/sys/posix/pthread.t.o \
        core/sys/posix/pwd.t.o core/sys/posix/sched.t.o \
        core/sys/posix/semaphore.t.o core/sys/posix/setjmp.t.o \
-       core/sys/posix/signal.t.o core/sys/posix/stdio.t.o \
-       core/sys/posix/stdlib.t.o core/sys/posix/sys/filio.t.o \
-       core/sys/posix/sys/ioccom.t.o core/sys/posix/sys/ioctl.t.o \
-       core/sys/posix/sys/ipc.t.o core/sys/posix/sys/mman.t.o \
-       core/sys/posix/sys/msg.t.o core/sys/posix/sys/resource.t.o \
-       core/sys/posix/sys/select.t.o core/sys/posix/sys/shm.t.o \
-       core/sys/posix/sys/socket.t.o core/sys/posix/sys/stat.t.o \
-       core/sys/posix/sys/statvfs.t.o core/sys/posix/sys/time.t.o \
-       core/sys/posix/sys/ttycom.t.o core/sys/posix/sys/types.t.o \
-       core/sys/posix/sys/uio.t.o core/sys/posix/sys/un.t.o \
-       core/sys/posix/sys/utsname.t.o core/sys/posix/sys/wait.t.o \
-       core/sys/posix/syslog.t.o core/sys/posix/termios.t.o \
-       core/sys/posix/time.t.o core/sys/posix/ucontext.t.o \
-       core/sys/posix/unistd.t.o core/sys/posix/utime.t.o
+       core/sys/posix/signal.t.o core/sys/posix/spawn.t.o \
+       core/sys/posix/stdio.t.o core/sys/posix/stdlib.t.o \
+       core/sys/posix/sys/filio.t.o core/sys/posix/sys/ioccom.t.o \
+       core/sys/posix/sys/ioctl.t.o core/sys/posix/sys/ipc.t.o \
+       core/sys/posix/sys/mman.t.o core/sys/posix/sys/msg.t.o \
+       core/sys/posix/sys/resource.t.o core/sys/posix/sys/select.t.o \
+       core/sys/posix/sys/shm.t.o core/sys/posix/sys/socket.t.o \
+       core/sys/posix/sys/stat.t.o core/sys/posix/sys/statvfs.t.o \
+       core/sys/posix/sys/time.t.o core/sys/posix/sys/ttycom.t.o \
+       core/sys/posix/sys/types.t.o core/sys/posix/sys/uio.t.o \
+       core/sys/posix/sys/un.t.o core/sys/posix/sys/utsname.t.o \
+       core/sys/posix/sys/wait.t.o core/sys/posix/syslog.t.o \
+       core/sys/posix/termios.t.o core/sys/posix/time.t.o \
+       core/sys/posix/ucontext.t.o core/sys/posix/unistd.t.o \
+       core/sys/posix/utime.t.o
 @DRUNTIME_OS_UNIX_TRUE@am__DEPENDENCIES_36 = $(am__DEPENDENCIES_35)
-am__DEPENDENCIES_37 = core/sys/darwin/dlfcn.t.o \
-       core/sys/darwin/execinfo.t.o core/sys/darwin/mach/dyld.t.o \
-       core/sys/darwin/mach/getsect.t.o \
+am__DEPENDENCIES_37 = core/sys/darwin/crt_externs.t.o \
+       core/sys/darwin/dlfcn.t.o core/sys/darwin/execinfo.t.o \
+       core/sys/darwin/mach/dyld.t.o core/sys/darwin/mach/getsect.t.o \
        core/sys/darwin/mach/kern_return.t.o \
        core/sys/darwin/mach/loader.t.o core/sys/darwin/mach/port.t.o \
        core/sys/darwin/mach/semaphore.t.o \
@@ -859,7 +862,7 @@ am__DEPENDENCIES_43 = core/sys/freebsd/dlfcn.t.o \
        core/sys/freebsd/sys/event.t.o \
        core/sys/freebsd/sys/link_elf.t.o \
        core/sys/freebsd/sys/mman.t.o core/sys/freebsd/sys/mount.t.o \
-       core/sys/freebsd/time.t.o
+       core/sys/freebsd/time.t.o core/sys/freebsd/unistd.t.o
 @DRUNTIME_OS_FREEBSD_TRUE@am__DEPENDENCIES_44 =  \
 @DRUNTIME_OS_FREEBSD_TRUE@     $(am__DEPENDENCIES_43)
 am__DEPENDENCIES_45 = core/sys/netbsd/dlfcn.t.o \
@@ -1390,14 +1393,14 @@ DRUNTIME_DSOURCES_GCSTUB = gcstub/gc.d
 DRUNTIME_DSOURCES_BIONIC = core/sys/bionic/fcntl.d \
        core/sys/bionic/unistd.d
 
-DRUNTIME_DSOURCES_DARWIN = core/sys/darwin/dlfcn.d \
-       core/sys/darwin/execinfo.d core/sys/darwin/mach/dyld.d \
-       core/sys/darwin/mach/getsect.d core/sys/darwin/mach/kern_return.d \
-       core/sys/darwin/mach/loader.d core/sys/darwin/mach/port.d \
-       core/sys/darwin/mach/semaphore.d core/sys/darwin/mach/thread_act.d \
-       core/sys/darwin/netinet/in_.d core/sys/darwin/pthread.d \
-       core/sys/darwin/sys/cdefs.d core/sys/darwin/sys/event.d \
-       core/sys/darwin/sys/mman.d
+DRUNTIME_DSOURCES_DARWIN = core/sys/darwin/crt_externs.d \
+       core/sys/darwin/dlfcn.d core/sys/darwin/execinfo.d \
+       core/sys/darwin/mach/dyld.d core/sys/darwin/mach/getsect.d \
+       core/sys/darwin/mach/kern_return.d core/sys/darwin/mach/loader.d \
+       core/sys/darwin/mach/port.d core/sys/darwin/mach/semaphore.d \
+       core/sys/darwin/mach/thread_act.d core/sys/darwin/netinet/in_.d \
+       core/sys/darwin/pthread.d core/sys/darwin/sys/cdefs.d \
+       core/sys/darwin/sys/event.d core/sys/darwin/sys/mman.d
 
 DRUNTIME_DSOURCES_DRAGONFLYBSD = core/sys/dragonflybsd/dlfcn.d \
        core/sys/dragonflybsd/execinfo.d core/sys/dragonflybsd/netinet/in_.d \
@@ -1417,7 +1420,7 @@ DRUNTIME_DSOURCES_FREEBSD = core/sys/freebsd/dlfcn.d \
        core/sys/freebsd/sys/elf64.d core/sys/freebsd/sys/elf_common.d \
        core/sys/freebsd/sys/event.d core/sys/freebsd/sys/link_elf.d \
        core/sys/freebsd/sys/mman.d core/sys/freebsd/sys/mount.d \
-       core/sys/freebsd/time.d
+       core/sys/freebsd/time.d core/sys/freebsd/unistd.d
 
 DRUNTIME_DSOURCES_LINUX = core/sys/linux/config.d \
        core/sys/linux/dlfcn.d core/sys/linux/elf.d core/sys/linux/epoll.d \
@@ -1451,18 +1454,19 @@ DRUNTIME_DSOURCES_POSIX = core/sys/posix/aio.d \
        core/sys/posix/netinet/in_.d core/sys/posix/netinet/tcp.d \
        core/sys/posix/poll.d core/sys/posix/pthread.d core/sys/posix/pwd.d \
        core/sys/posix/sched.d core/sys/posix/semaphore.d \
-       core/sys/posix/setjmp.d core/sys/posix/signal.d core/sys/posix/stdio.d \
-       core/sys/posix/stdlib.d core/sys/posix/sys/filio.d \
-       core/sys/posix/sys/ioccom.d core/sys/posix/sys/ioctl.d \
-       core/sys/posix/sys/ipc.d core/sys/posix/sys/mman.d \
-       core/sys/posix/sys/msg.d core/sys/posix/sys/resource.d \
-       core/sys/posix/sys/select.d core/sys/posix/sys/shm.d \
-       core/sys/posix/sys/socket.d core/sys/posix/sys/stat.d \
-       core/sys/posix/sys/statvfs.d core/sys/posix/sys/time.d \
-       core/sys/posix/sys/ttycom.d core/sys/posix/sys/types.d \
-       core/sys/posix/sys/uio.d core/sys/posix/sys/un.d \
-       core/sys/posix/sys/utsname.d core/sys/posix/sys/wait.d \
-       core/sys/posix/syslog.d core/sys/posix/termios.d core/sys/posix/time.d \
+       core/sys/posix/setjmp.d core/sys/posix/signal.d core/sys/posix/spawn.d \
+       core/sys/posix/stdio.d core/sys/posix/stdlib.d \
+       core/sys/posix/sys/filio.d core/sys/posix/sys/ioccom.d \
+       core/sys/posix/sys/ioctl.d core/sys/posix/sys/ipc.d \
+       core/sys/posix/sys/mman.d core/sys/posix/sys/msg.d \
+       core/sys/posix/sys/resource.d core/sys/posix/sys/select.d \
+       core/sys/posix/sys/shm.d core/sys/posix/sys/socket.d \
+       core/sys/posix/sys/stat.d core/sys/posix/sys/statvfs.d \
+       core/sys/posix/sys/time.d core/sys/posix/sys/ttycom.d \
+       core/sys/posix/sys/types.d core/sys/posix/sys/uio.d \
+       core/sys/posix/sys/un.d core/sys/posix/sys/utsname.d \
+       core/sys/posix/sys/wait.d core/sys/posix/syslog.d \
+       core/sys/posix/termios.d core/sys/posix/time.d \
        core/sys/posix/ucontext.d core/sys/posix/unistd.d \
        core/sys/posix/utime.d
 
@@ -1859,6 +1863,7 @@ core/sys/posix/sched.lo: core/sys/posix/$(am__dirstamp)
 core/sys/posix/semaphore.lo: core/sys/posix/$(am__dirstamp)
 core/sys/posix/setjmp.lo: core/sys/posix/$(am__dirstamp)
 core/sys/posix/signal.lo: core/sys/posix/$(am__dirstamp)
+core/sys/posix/spawn.lo: core/sys/posix/$(am__dirstamp)
 core/sys/posix/stdio.lo: core/sys/posix/$(am__dirstamp)
 core/sys/posix/stdlib.lo: core/sys/posix/$(am__dirstamp)
 core/sys/posix/sys/$(am__dirstamp):
@@ -1892,6 +1897,7 @@ core/sys/posix/utime.lo: core/sys/posix/$(am__dirstamp)
 core/sys/darwin/$(am__dirstamp):
        @$(MKDIR_P) core/sys/darwin
        @: > core/sys/darwin/$(am__dirstamp)
+core/sys/darwin/crt_externs.lo: core/sys/darwin/$(am__dirstamp)
 core/sys/darwin/dlfcn.lo: core/sys/darwin/$(am__dirstamp)
 core/sys/darwin/execinfo.lo: core/sys/darwin/$(am__dirstamp)
 core/sys/darwin/mach/$(am__dirstamp):
@@ -1989,6 +1995,7 @@ core/sys/freebsd/sys/link_elf.lo:  \
 core/sys/freebsd/sys/mman.lo: core/sys/freebsd/sys/$(am__dirstamp)
 core/sys/freebsd/sys/mount.lo: core/sys/freebsd/sys/$(am__dirstamp)
 core/sys/freebsd/time.lo: core/sys/freebsd/$(am__dirstamp)
+core/sys/freebsd/unistd.lo: core/sys/freebsd/$(am__dirstamp)
 core/sys/netbsd/$(am__dirstamp):
        @$(MKDIR_P) core/sys/netbsd
        @: > core/sys/netbsd/$(am__dirstamp)
index 03c88d79cb8c2bfaef6d2ed24c250e0c463524de..06c2b5d94b67dc22bc069093d14ab2736eab9016 100644 (file)
@@ -75,6 +75,24 @@ else version (CRuntime_Musl)
         alias errno = __errno_location;
     }
 }
+else version (OpenBSD)
+{
+    // https://github.com/openbsd/src/blob/master/include/errno.h
+    extern (C)
+    {
+        ref int __errno();
+        alias errno = __errno;
+    }
+}
+else version (NetBSD)
+{
+    // https://github.com/NetBSD/src/blob/trunk/include/errno.h
+    extern (C)
+    {
+        ref int __errno();
+        alias errno = __errno;
+    }
+}
 else version (FreeBSD)
 {
     extern (C)
@@ -85,8 +103,14 @@ else version (FreeBSD)
 }
 else version (DragonFlyBSD)
 {
-    pragma(mangle, "errno") extern int __errno;
-    ref int errno() { return __errno;}
+    extern (C)
+    {
+        pragma(mangle, "errno") int __errno;
+        ref int __error() {
+            return __errno;
+        }
+        alias errno = __error;
+    }
 }
 else version (CRuntime_Bionic)
 {
index d4abc12f502c22c7f8408086acaa92bea7876a41..a1a52141e24631eba0729735a5dbd9c7fc11851b 100644 (file)
@@ -330,6 +330,24 @@ else version (CRuntime_Bionic)
 
         alias uint fexcept_t;
     }
+    else version (X86_64)
+    {
+        struct fenv_t
+        {
+            struct _x87
+            {
+                uint    __control;
+                uint    __status;
+                uint    __tag;
+                uint[4] __others;
+            }
+            _x87 __x87;
+
+            uint __mxcsr;
+        }
+
+        alias uint fexcept_t;
+    }
     else
     {
         static assert(false, "Architecture not supported.");
index c04b9c41228044de87754a9907ceb0ec50ffd79b..e708a51763c7cad77948c3fcbce1f31f7d5ceed4 100644 (file)
@@ -429,7 +429,7 @@ else version (CRuntime_Glibc)
         int     _old_offset;
         ushort  _cur_column;
         byte    _vtable_offset;
-        char[1] _shortbuf;
+        char[1] _shortbuf = 0;
         void*   _lock;
     }
 
@@ -442,7 +442,7 @@ else version (CRuntime_Musl)
 {
     union fpos_t
     {
-        char[16] __opaque;
+        char[16] __opaque = 0;
         double __align;
     }
     struct _IO_FILE;
@@ -572,7 +572,7 @@ else version (NetBSD)
 
         int     function(void *)    _flush;
         /* Formerly used by fgetln/fgetwln; kept for binary compatibility */
-        char[__sbuf.sizeof - _flush.sizeof]    _lb_unused;
+        char[__sbuf.sizeof - _flush.sizeof]    _lb_unused = void;
 
 
         int             _blksize;
@@ -672,8 +672,8 @@ else version (Solaris)
             char* _ptr;
             int _cnt;
             char* _base;
-            char _flag;
-            char _magic;
+            char _flag = 0;
+            char _magic = 0;
             ushort __flags; // __orientation:2
                             // __ionolock:1
                             // __seekable:1
@@ -756,7 +756,7 @@ else version (CRuntime_UClibc)
     struct __STDIO_FILE_STRUCT
     {
         ushort __modeflags;
-        char[2] __ungot_width;
+        char[2] __ungot_width = 0;
         int __filedes;
         char* __bufstart;
         char* __bufend;
@@ -767,7 +767,7 @@ else version (CRuntime_UClibc)
         __STDIO_FILE_STRUCT* __nextopen;
         void *__cookie;
         _IO_cookie_io_functions_t __gcs;
-        wchar_t[2] __ungot;
+        wchar_t[2] __ungot = 0;
         mbstate_t __state;
         void *__unused;
         int __user_locking;
index 05c3ad862bc09f1df80a7f11a1a915902ae6fabb..1cf8678f4cc3c0d1691b7b8c73f6fc15af69bc78 100644 (file)
@@ -37,7 +37,7 @@ version (CRuntime_Glibc)
         int __count;
         union ___value
         {
-            wint_t __wch;
+            wint_t __wch = 0;
             char[4] __wchb;
         }
         ___value __value;
@@ -72,7 +72,7 @@ else version (OpenBSD)
     ///
     union __mbstate_t
     {
-        char[128] __mbstate8;
+        char[128] __mbstate8 = 0;
         int64_t   __mbstateL;
     }
 
@@ -114,8 +114,8 @@ else version (CRuntime_UClibc)
     ///
     struct mbstate_t
     {
-        wchar_t __mask;
-        wchar_t __wc;
+        wchar_t __mask = 0;
+        wchar_t __wc = 0;
     }
 }
 else
index 7e57440644a1b780ef6e7b8396bbe8ea6ce32f12..798f8412a0218974bd536534f7dd9e1a6299b7db 100644 (file)
@@ -374,9 +374,10 @@ unittest
     // by checking that locking is not possible. This assumes
     // that the underlying implementation is well behaved
     // and makes the object non-lockable upon destruction.
-    // For example, Bionic doesn't appear to do so, so this test is
-    // not run on Android.
+    // The Bionic and Musl C runtimes and DragonFly don't appear to do so, so skip this test.
     version (CRuntime_Bionic) {} else
+    version (CRuntime_Musl) {} else
+    version (DragonFlyBSD) {} else
     assert(!mtx.tryLock_nothrow());
 
     free(cast(void*) mtx);
diff --git a/libphobos/libdruntime/core/sys/darwin/crt_externs.d b/libphobos/libdruntime/core/sys/darwin/crt_externs.d
new file mode 100644 (file)
index 0000000..ec0788d
--- /dev/null
@@ -0,0 +1,101 @@
+/**
+ * D header file for $(LINK2 https://opensource.apple.com/source/Libc/Libc-1244.30.3/include/crt_externs.h.auto.html, libc/crt_externs.h).
+ *
+ * Copyright: Copyright (c) 2018 D Language Foundation
+ * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
+ * Authors:   Jacob Carlborg
+ * Source:    $(DRUNTIMESRC core/sys/darwin/_crt_externs.d)
+ */
+module core.sys.darwin.crt_externs;
+
+version (CoreDoc)
+{
+    /**
+     * In reality this will be $(REF mach_header, core, sys, darwin, mach, loader)
+     * on 32-bit platforms and $(REF mach_header_64, core, sys, darwin, mach, loader)
+     * 64-bit platforms.
+     */
+    struct MachHeader;
+
+    /**
+     * Returns the program arguments.
+     *
+     * These are the same arguments passed to the C main function:
+     *
+     * ___
+     * extern (C) void main (char** argv, int argc, char** envp) {}
+     * ___
+     *
+     * Same as the above `argv`.
+     *
+     * Return: the program arguments as a pointer to an array of null terminated C
+     *  strings
+     */
+    char*** _NSGetArgv();
+
+    /**
+     * Returns the number of program arguments.
+     *
+     * These are the same arguments passed to the C main function:
+     *
+     * ___
+     * extern (C) void main (char** argv, int argc, char** envp) {}
+     * ___
+     *
+     * Same as the above `argc`.
+     *
+     * Return: a pointer to the number of program arguments
+     */
+    int* _NSGetArgc();
+
+    /**
+     * Returns the program environment variables.
+     *
+     * These are the same arguments passed as an array to the C main function:
+     *
+     * ___
+     * extern (C) void main (char** argv, int argc, char** envp) {}
+     * ___
+     *
+     * Same as the above `envp`.
+     *
+     * Return: the program environment variables as a pointer to an array of null
+     *  terminated C strings
+     */
+    char*** _NSGetEnviron();
+
+    /**
+     * Returns the full path to the current executable as a pointer to a null
+     * terminated C string.
+     */
+    char** _NSGetProgname();
+
+    /// Returns the Mach-O header of the current executable.
+    MachHeader* _NSGetMachExecuteHeader();
+}
+
+else version (OSX)
+    version = Darwin;
+else version (iOS)
+    version = Darwin;
+else version (TVOS)
+    version = Darwin;
+else version (WatchOS)
+    version = Darwin;
+
+version (Darwin):
+extern(C):
+nothrow:
+@nogc:
+
+import core.sys.darwin.mach.loader : mach_header, mach_header_64;
+
+char*** _NSGetArgv();
+int* _NSGetArgc();
+char*** _NSGetEnviron();
+char** _NSGetProgname();
+
+version (D_LP64)
+    mach_header_64* _NSGetMachExecuteHeader();
+else
+    mach_header* _NSGetMachExecuteHeader();
index e6dbf5fec655e6d4c7af6896b10ddb2966f85e5c..cf89747d0f2a2efa852a11a52b23ca67e514d3f5 100644 (file)
@@ -320,7 +320,7 @@ version (CoreDdoc)
      * Params:
      *  mhp = the mach header to get the section from
      *  segname = the name of the segment
-     *  sectname = the name of the section
+     *  section = the name of the section
      *  fSwap = ?
      *
      * Returns: a pointer to the section structure or `null` if it doesn't exist
index 1254f3ff9cb1794f20afd5a6642a307f7425dd84..0330e55477f1cb505b64cb50f8fdf42f6c5be210 100644 (file)
@@ -144,7 +144,7 @@ version (CoreDdoc)
         uint cmdsize;
 
         /// The name of this segment.
-        char[16] segname;
+        char[16] segname = 0;
 
         /// Memory address of this segment.
         uint vmaddr;
@@ -181,7 +181,7 @@ version (CoreDdoc)
         uint cmdsize;
 
         /// The name of this segment.
-        char[16] segname;
+        char[16] segname = 0;
 
         /// Memory address of this segment.
         long vmaddr;
@@ -212,10 +212,10 @@ version (CoreDdoc)
     struct section
     {
         /// The name of this this section.
-        char[16] sectname;
+        char[16] sectname = 0;
 
         /// The name of the segment this section belongs to.
-        char[16] segname;
+        char[16] segname = 0;
 
         /// The memory address of this section.
         uint addr;
@@ -249,10 +249,10 @@ version (CoreDdoc)
     struct section_64
     {
         /// The name of this this section.
-        char[16] sectname;
+        char[16] sectname = 0;
 
         /// The name of the segment this section belongs to.
-        char[16] segname;
+        char[16] segname = 0;
 
         /// The memory address of this section.
         ulong addr;
@@ -351,7 +351,7 @@ struct segment_command
 {
     uint cmd;
     uint cmdsize;
-    char[16] segname;
+    char[16] segname = 0;
     uint vmaddr;
     uint vmsize;
     uint fileoff;
@@ -366,7 +366,7 @@ struct segment_command_64
 {
     uint cmd;
     uint cmdsize;
-    char[16] segname;
+    char[16] segname = 0;
     long vmaddr;
     long vmsize;
     long fileoff;
@@ -379,8 +379,8 @@ struct segment_command_64
 
 struct section
 {
-    char[16] sectname;
-    char[16] segname;
+    char[16] sectname = 0;
+    char[16] segname = 0;
     uint     addr;
     uint     size;
     uint     offset;
@@ -394,8 +394,8 @@ struct section
 
 struct section_64
 {
-    char[16] sectname;
-    char[16] segname;
+    char[16] sectname = 0;
+    char[16] segname = 0;
     ulong    addr;
     ulong    size;
     uint     offset;
index 9f1835edcd631a6c5081a1fbf3634c5883ccd455..0653d3a4b59eed64cd8660c51bccf11795e760a4 100644 (file)
@@ -224,7 +224,7 @@ static if (_DARWIN_C_SOURCE)
     struct ip_opts
     {
         in_addr  ip_dst;
-        char[40] ip_opts;
+        char[40] ip_opts = 0;
     };
 
     enum IP_OPTIONS         = 1;
index 92d4a462174c0cfcd4eb226663f8e20ba21d0a21..2c35d0b59a3f6e0582a08c6dd7d93d9551397d18 100644 (file)
@@ -25,7 +25,7 @@ alias Elf32_Sword Elf32_Ssize;
 
 struct Elf32_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf32_Half    e_type;
     Elf32_Half    e_machine;
     Elf32_Word    e_version;
index 38db4cd8e2384ad3a0933ae54fac6863c67421bd..94b7e42b5cd8f200b9cc996cceea2c8c1f6c2807 100644 (file)
@@ -27,7 +27,7 @@ alias Elf64_Sxword Elf64_Ssize;
 
 struct Elf64_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf64_Half    e_type;
     Elf64_Half    e_machine;
     Elf64_Word    e_version;
index 9e674b6c24dfad2f755e18221e31ef690dee65d3..02b6fda910e6dbd23400196b527d643ba9de20de 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Authors:   Martin Nowak
  */
-module core.sys.freebsd.pthread;
+module core.sys.freebsd.pthread_np;
 
 version (FreeBSD):
 extern (C) nothrow @nogc:
index 4a55a0c001cd377a3386d03273e879fa4b981e1d..61455223b71a3a71b617d076da0338821b589460 100644 (file)
@@ -25,7 +25,7 @@ alias Elf32_Sword Elf32_Ssize;
 
 struct Elf32_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf32_Half    e_type;
     Elf32_Half    e_machine;
     Elf32_Word    e_version;
index d3c189ebd60f269f970336ceacf94a31fa78d61c..29c6e3c01b7e648e16d1d180ceb15bce85000307 100644 (file)
@@ -27,7 +27,7 @@ alias Elf64_Sxword Elf64_Ssize;
 
 struct Elf64_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf64_Half    e_type;
     Elf64_Half    e_machine;
     Elf64_Word    e_version;
index ba20b44605d3c1245c20b43f1113322968fb8a93..66c69a4fd81e5e7aa43fcfd5e5cc64c1e2214741 100644 (file)
@@ -28,7 +28,7 @@ struct fid
 {
     ushort         fid_len;
     ushort         fid_data0;
-    char[MAXFIDSZ] fid_data;
+    char[MAXFIDSZ] fid_data = 0;
 }
 
 enum MFSNAMELEN = 16;
@@ -55,10 +55,10 @@ struct statfs_t
     uint f_namemax;
     uid_t f_owner;
     fsid_t f_fsid;
-    char[80] f_charspare;
-    char[MFSNAMELEN] f_fstypename;
-    char[MNAMELEN] f_mntfromname;
-    char[MNAMELEN] f_mntonname;
+    char[80] f_charspare = 0;
+    char[MFSNAMELEN] f_fstypename = 0;
+    char[MNAMELEN] f_mntfromname = 0;
+    char[MNAMELEN] f_mntonname = 0;
 }
 
 
@@ -207,7 +207,7 @@ struct nfs_public
 struct vfsconf
 {
     uint vfc_version;
-    char[MFSNAMELEN] vfc_name;
+    char[MFSNAMELEN] vfc_name = 0;
     vfsops* vfc_vfsops;
     int vfc_typenum;
     int vfc_refcount;
@@ -219,7 +219,7 @@ struct vfsconf
 struct xvfsconf
 {
     vfsops* vfc_vfsops;
-    char[MFSNAMELEN] vfc_name;
+    char[MFSNAMELEN] vfc_name = 0;
     int vfc_typenum;
     int vfc_refcount;
     int vfc_flags;
@@ -230,7 +230,7 @@ struct xvfsconf
 struct ovfsconf
 {
     void* vfc_vfsops;
-    char[32] vfc_name;
+    char[32] vfc_name = 0;
     int vfc_index;
     int vfc_refcount;
     int vfc_flags;
@@ -252,7 +252,7 @@ struct vfsidctl
 {
     int vc_vers;
     fsid_t vc_fsid;
-    char[MFSNAMELEN] vc_fstypename;
+    char[MFSNAMELEN] vc_fstypename = 0;
     fsctlop_t vc_op;
     void* vc_ptr;
     size_t vc_len;
diff --git a/libphobos/libdruntime/core/sys/freebsd/unistd.d b/libphobos/libdruntime/core/sys/freebsd/unistd.d
new file mode 100644 (file)
index 0000000..493cda1
--- /dev/null
@@ -0,0 +1,19 @@
+//Written in the D programming language
+
+/++
+    D header file for FreeBSD's extensions to POSIX's unistd.h.
+
+    Copyright: Copyright 2018
+    License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
+    Authors:   $(HTTP jmdavisprog.com, Jonathan M Davis)
+ +/
+module core.sys.freebsd.unistd;
+
+public import core.sys.posix.unistd;
+
+version (FreeBSD):
+extern(C):
+@nogc:
+nothrow:
+
+int getosreldate() pure @trusted;
index 45e89eae6022e095f2c98cd5405dbd15d9e63d86..ab07ac941085710215a11b6caf7653bf470b71d8 100644 (file)
@@ -42,7 +42,7 @@ enum EI_NIDENT = 16;
 
 struct Elf32_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf32_Half    e_type;
     Elf32_Half    e_machine;
     Elf32_Word    e_version;
@@ -60,7 +60,7 @@ struct Elf32_Ehdr
 
 struct Elf64_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf64_Half    e_type;
     Elf64_Half    e_machine;
     Elf64_Word    e_version;
index 5b4431a066c926e3e37b75d92c6cb995b8ada198..4798967c79d4aa94d25f9ef84790c630b6e20ab2 100644 (file)
@@ -50,6 +50,7 @@ enum
     EPOLLERR    = 0x008,
     EPOLLHUP    = 0x010,
     EPOLLRDHUP  = 0x2000, // since Linux 2.6.17
+    EPOLLEXCLUSIVE = 1u << 28, // since Linux 4.5
     EPOLLONESHOT = 1u << 30,
     EPOLLET     = 1u << 31
 }
index 987414ef539844704819dc55ade2cd766a6b0308..47102e11eb878c8bcf29ac9294ab09f39092914c 100644 (file)
@@ -312,7 +312,7 @@ version (linux_libc)
         struct ip_opts
         {
             in_addr ip_dst;
-            char[40] ip_opts;
+            char[40] ip_opts = 0;
         };
 
         struct ip_mreqn
index a5f334acd442fc9593629aff9516dcfa9cac6d5d..b53fa0454000daa4d201680180246e72f786a76e 100644 (file)
@@ -14,6 +14,7 @@
 
 module core.sys.linux.sched;
 
+import core.bitop : popcnt;
 import core.sys.posix.sched;
 import core.sys.posix.config;
 import core.sys.posix.sys.types;
@@ -56,6 +57,21 @@ private // helpers
 
         return 0;
     }
+
+    bool __CPU_ISSET_S(size_t cpu, size_t setsize, cpu_set_t* cpusetp) pure
+    {
+        if (cpu < 8 * setsize)
+            return (cpusetp.__bits[__CPUELT(cpu)] & __CPUMASK(cpu)) != 0;
+        return false;
+    }
+
+    int __CPU_COUNT_S(size_t setsize, cpu_set_t* cpusetp) pure
+    {
+        int s = 0;
+        foreach (i; cpusetp.__bits[0 .. (setsize / cpu_mask.sizeof)])
+            s += popcnt(i);
+        return s;
+    }
 }
 
 /// Type for array elements in 'cpu_set_t'.
@@ -74,7 +90,16 @@ cpu_mask CPU_SET(size_t cpu, cpu_set_t* cpusetp) pure
      return __CPU_SET_S(cpu, cpu_set_t.sizeof, cpusetp);
 }
 
+bool CPU_ISSET(size_t cpu, cpu_set_t* cpusetp) pure
+{
+    return __CPU_ISSET_S(cpu, cpu_set_t.sizeof, cpusetp);
+}
+
+int CPU_COUNT(cpu_set_t* cpusetp) pure
+{
+    return __CPU_COUNT_S(cpu_set_t.sizeof, cpusetp);
+}
+
 /* Functions */
 int sched_setaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask);
 int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask);
-
index 7fdd693d815084dfac0f1a920841ba38580aedd1..0954b3f02579e1c86a41cadccbd2a537e9ecbbfa 100644 (file)
@@ -43,7 +43,28 @@ int eventfd_read (int fd, eventfd_t* value);
 /* Increment event counter.  */
 int eventfd_write (int fd, eventfd_t value);
 
-version (X86_Any)
+version (CRuntime_UClibc)
+{
+    version (MIPS_Any)
+    {
+        enum EFD_SEMAPHORE = 1;
+        enum EFD_CLOEXEC = 0x80000; // octal!02000000
+        enum EFD_NONBLOCK = 0x80; // octal!00000200
+    }
+    else version (SPARC_Any)
+    {
+        enum EFD_SEMAPHORE = 1;
+        enum EFD_CLOEXEC = 0x400000;
+        enum EFD_NONBLOCK = 0x004000;
+    }
+    else
+    {
+        enum EFD_SEMAPHORE = 1;
+        enum EFD_CLOEXEC = 0x80000; // octal!02000000
+        enum EFD_NONBLOCK = 0x800; // octal!00004000
+    }
+}
+else version (X86_Any)
 {
     enum EFD_SEMAPHORE = 1;
     enum EFD_CLOEXEC = 0x80000; // octal!2000000
index e30addbc03c4bada8619874490af8f635c793d2a..b22b97f9f3c996ca4fc8a88517f5557d33537cde 100644 (file)
@@ -25,7 +25,7 @@ alias Elf32_Sword Elf32_Ssize;
 
 struct Elf32_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf32_Half    e_type;
     Elf32_Half    e_machine;
     Elf32_Word    e_version;
index c1583f2f890e18fef3ad8d03877b88da4e238198..f78d066ef6928e3b06d3cde5f844ab62224bdcad 100644 (file)
@@ -27,7 +27,7 @@ alias Elf64_Sxword Elf64_Ssize;
 
 struct Elf64_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf64_Half    e_type;
     Elf64_Half    e_machine;
     Elf64_Word    e_version;
index be36a03e229bf2415ad9627d1b274c01a4a5d486..47458160f2efcc472971c0dfb72481cd3058c30d 100644 (file)
@@ -72,6 +72,27 @@ version (CRuntime_Glibc)
         }
     }
 }
+else version (CRuntime_Musl)
+{
+    // https://git.musl-libc.org/cgit/musl/tree/include/aio.h
+    struct aiocb
+    {
+        int aio_fildes;
+        int aio_lio_opcode;
+        int aio_reqprio;
+        void* aio_buf;   //volatile
+        size_t aio_nbytes;
+        sigevent aio_sigevent;
+        void* __td;
+        int[2] __lock;
+        int __err;   //volatile
+        ssize_t __ret;
+        off_t aio_offset;
+        void* __next;
+        void* __prev;
+        ubyte[32-2*(void*).sizeof] __dummy4;
+    }
+}
 else version (Darwin)
 {
     struct aiocb
@@ -180,6 +201,15 @@ version (CRuntime_Glibc)
         AIO_ALLDONE
     }
 }
+else version (CRuntime_Musl)
+{
+    enum
+    {
+        AIO_CANCELED,
+        AIO_NOTCANCELED,
+        AIO_ALLDONE
+    }
+}
 else version (Darwin)
 {
     enum
@@ -218,6 +248,15 @@ version (CRuntime_Glibc)
         LIO_NOP
     }
 }
+else version (CRuntime_Musl)
+{
+    enum
+    {
+        LIO_READ,
+        LIO_WRITE,
+        LIO_NOP
+    }
+}
 else version (Darwin)
 {
     enum
@@ -255,6 +294,14 @@ version (CRuntime_Glibc)
         LIO_NOWAIT
     }
 }
+else version (CRuntime_Musl)
+{
+    enum
+    {
+        LIO_WAIT,
+        LIO_NOWAIT
+    }
+}
 else version (Darwin)
 {
     enum
index 43e2a4751620045900b21c0036cf33eeac36c384..61de95802c1f5b262a7bc43dd294d15d66a3aac0 100644 (file)
@@ -107,6 +107,10 @@ else version (CRuntime_UClibc)
     else
         enum __WORDSIZE=32;
 }
+else version (CRuntime_Bionic)
+{
+    enum __USE_GNU           = false;
+}
 else version (Solaris)
 {
     enum _FILE_OFFSET_BITS = 64;
index 9c5ee30270da6af749f2fe43572553ee0cad8f3c..95246fc44719794d73450f39929343c932da94b4 100644 (file)
@@ -72,7 +72,7 @@ version (CRuntime_Glibc)
         off_t       d_off;
         ushort      d_reclen;
         ubyte       d_type;
-        char[256]   d_name;
+        char[256]   d_name = 0;
     }
 
     struct DIR
@@ -116,7 +116,7 @@ else version (Darwin)
         ushort      d_reclen;
         ushort      d_namlen;
         ubyte       d_type;
-        char[1024]  d_name;
+        char[1024]  d_name = 0;
     }
 
     struct DIR
@@ -156,7 +156,7 @@ else version (FreeBSD)
         ushort    d_reclen;
         ubyte     d_type;
         ubyte     d_namlen;
-        char[256] d_name;
+        char[256] d_name = 0;
     }
 
     alias void* DIR;
@@ -184,7 +184,7 @@ else version (NetBSD)
         ushort    d_reclen;
         ushort    d_namlen;
         ubyte     d_type;
-        char[512] d_name;
+        char[512] d_name = 0;
     }
 
     alias void* DIR;
@@ -215,7 +215,7 @@ else version (OpenBSD)
         ubyte     d_type;
         ubyte     d_namlen;
         ubyte[4]  __d_padding;
-        char[256] d_name;
+        char[256] d_name = 0;
     }
 
     alias void* DIR;
@@ -245,7 +245,7 @@ else version (DragonFlyBSD)
         ubyte     d_type;         /* file type, see blow */
         ubyte     d_unused1;      /* padding, reserved */
         uint      d_unused2;      /* reserved */
-        char[256] d_name;         /* name, NUL-terminated */
+        char[256] d_name = 0;     /* name, NUL-terminated */
     }
 
     alias void* DIR;
@@ -259,7 +259,7 @@ else version (Solaris)
         ino_t d_ino;
         off_t d_off;
         ushort d_reclen;
-        char[1] d_name;
+        char[1] d_name = 0;
     }
 
     struct DIR
@@ -309,7 +309,7 @@ else version (CRuntime_Bionic)
         long        d_off;
         ushort      d_reclen;
         ubyte       d_type;
-        char[256]   d_name;
+        char[256]   d_name = 0;
     }
 
     struct DIR
@@ -339,7 +339,7 @@ else version (CRuntime_Musl)
         off_t       d_off;
         ushort      d_reclen;
         ubyte       d_type;
-        char[256]   d_name;
+        char[256]   d_name = 0;
     }
 
     struct DIR
@@ -387,7 +387,7 @@ else version (CRuntime_UClibc)
         }
         ushort      d_reclen;
         ubyte       d_type;
-        char[256]   d_name;
+        char[256]   d_name = 0;
     }
 
     struct DIR
index 817790ab7eb9a0eb4d8edad669d54e7ad88dc05e..4b06600d9fa9046582feaf0aaf806b534cb5b993 100644 (file)
@@ -734,42 +734,21 @@ else version (CRuntime_Bionic)
     enum F_WRLCK        = 1;
     enum F_UNLCK        = 2;
 
-    version (X86)
-    {
-        enum O_CREAT        = 0x40;     // octal     0100
-        enum O_EXCL         = 0x80;     // octal     0200
-        enum O_NOCTTY       = 0x100;    // octal     0400
-        enum O_TRUNC        = 0x200;    // octal    01000
+    enum O_CREAT        = 0x40;     // octal     0100
+    enum O_EXCL         = 0x80;     // octal     0200
+    enum O_NOCTTY       = 0x100;    // octal     0400
+    enum O_TRUNC        = 0x200;    // octal    01000
 
-        enum O_APPEND       = 0x400;    // octal    02000
-        enum O_NONBLOCK     = 0x800;    // octal    04000
-        enum O_SYNC         = 0x1000;   // octal   010000
-    }
-    else version (ARM)
-    {
-        enum O_CREAT        = 0x40;     // octal     0100
-        enum O_EXCL         = 0x80;     // octal     0200
-        enum O_NOCTTY       = 0x100;    // octal     0400
-        enum O_TRUNC        = 0x200;    // octal    01000
+    enum O_APPEND       = 0x400;    // octal    02000
+    enum O_NONBLOCK     = 0x800;    // octal    04000
 
-        enum O_APPEND       = 0x400;    // octal    02000
-        enum O_NONBLOCK     = 0x800;    // octal    04000
-        enum O_SYNC         = 0x1000;   // octal   010000
-    }
-    else version (AArch64)
+    version (D_LP64)
     {
-        enum O_CREAT        = 0x40;     // octal     0100
-        enum O_EXCL         = 0x80;     // octal     0200
-        enum O_NOCTTY       = 0x100;    // octal     0400
-        enum O_TRUNC        = 0x200;    // octal    01000
-
-        enum O_APPEND       = 0x400;    // octal    02000
-        enum O_NONBLOCK     = 0x800;    // octal    04000
-        enum O_SYNC         = 0x101000; // octal 04010000
+        enum O_SYNC     = 0x101000; // octal 04010000
     }
     else
     {
-        static assert(false, "Architecture not supported.");
+        enum O_SYNC     = 0x1000;   // octal   010000
     }
 
     enum O_ACCMODE      = 0x3;
index 9028dbc65fc810f19a23dbbb093d1ce6f720c1c0..8b636683e3d02136d8e1aaee201596edd3e48096 100644 (file)
@@ -297,6 +297,10 @@ else version (CRuntime_Bionic)
     {
         enum _JBLEN = 32;
     }
+    else version (X86_64)
+    {
+        enum _JBLEN = 11;
+    }
     else
     {
         static assert(false, "Architecture not supported.");
index 68739dd78920a556fbb71e3310253efa31dc4709..e795a215b4ebc2af6a5e554b6834812eeffee73d 100644 (file)
@@ -743,10 +743,11 @@ else version (CRuntime_UClibc)
 }
 else version (CRuntime_Bionic)
 {
-    version (X86)
+    version (D_LP64)
     {
         struct sigaction_t
         {
+            int            sa_flags;
             union
             {
                 sigfn_t    sa_handler;
@@ -754,11 +755,10 @@ else version (CRuntime_Bionic)
             }
 
             sigset_t        sa_mask;
-            int             sa_flags;
             void function() sa_restorer;
         }
     }
-    else version (ARM)
+    else
     {
         struct sigaction_t
         {
@@ -773,25 +773,6 @@ else version (CRuntime_Bionic)
             void function() sa_restorer;
         }
     }
-    else version (AArch64)
-    {
-        struct sigaction_t
-        {
-            int            sa_flags;
-            union
-            {
-                sigfn_t    sa_handler;
-                sigactfn_t sa_sigaction;
-            }
-
-            sigset_t        sa_mask;
-            void function() sa_restorer;
-        }
-    }
-    else
-    {
-        static assert(false, "Architecture not supported.");
-    }
 }
 else version (Darwin)
 {
@@ -1437,8 +1418,8 @@ else version (Solaris)
                 caddr_t __faddr;
                 timestruc_t __tstamp;
                 short __syscall;
-                char __nsysarg;
-                char __fault;
+                char __nsysarg = 0;
+                char __fault = 0;
                 c_long[8] __sysarg;
                 int[10] __mstate;
             }
@@ -1475,12 +1456,12 @@ else version (CRuntime_Bionic)
 
     version (X86)
     {
-        alias c_ulong sigset_t;
+        alias uint sigset_t;
         enum int LONG_BIT = 32;
     }
     else version (ARM)
     {
-        alias c_ulong sigset_t;
+        alias uint sigset_t;
         enum int LONG_BIT = 32;
     }
     else version (AArch64)
@@ -1488,6 +1469,11 @@ else version (CRuntime_Bionic)
         struct sigset_t { ulong[1] sig; }
         enum int LONG_BIT = 64;
     }
+    else version (X86_64)
+    {
+        alias ulong sigset_t;
+        enum int LONG_BIT = 64;
+    }
     else
     {
         static assert(false, "Architecture not supported.");
@@ -1614,7 +1600,7 @@ else version (CRuntime_Musl)
     struct siginfo_t {
         int si_signo, si_errno, si_code;
         union __si_fields_t {
-            char[128 - 2*int.sizeof - long.sizeof] __pad;
+            char[128 - 2*int.sizeof - long.sizeof] __pad = 0;
             struct __si_common_t {
                 union __first_t {
                     struct __piduid_t {
@@ -2943,93 +2929,30 @@ else version (Solaris)
 }
 else version (CRuntime_Bionic)
 {
-    version (X86)
-    {
-        enum SIGPOLL   = 29;
-        enum SIGPROF   = 27;
-        enum SIGSYS    = 31;
-        enum SIGTRAP   = 5;
-        enum SIGVTALRM = 26;
-        enum SIGXCPU   = 24;
-        enum SIGXFSZ   = 25;
-
-        enum SA_ONSTACK     = 0x08000000;
-        enum SA_RESETHAND   = 0x80000000;
-        enum SA_RESTART     = 0x10000000;
-        enum SA_SIGINFO     = 4;
-        enum SA_NOCLDWAIT   = 2;
-        enum SA_NODEFER     = 0x40000000;
-        enum SS_ONSTACK     = 1;
-        enum SS_DISABLE     = 2;
-        enum MINSIGSTKSZ    = 2048;
-        enum SIGSTKSZ       = 8192;
-
-        struct stack_t
-        {
-            void*   ss_sp;
-            int     ss_flags;
-            size_t  ss_size;
-        }
-    }
-    else version (ARM)
-    {
-        enum SIGPOLL   = 29;
-        enum SIGPROF   = 27;
-        enum SIGSYS    = 31;
-        enum SIGTRAP   = 5;
-        enum SIGVTALRM = 26;
-        enum SIGXCPU   = 24;
-        enum SIGXFSZ   = 25;
-
-        enum SA_ONSTACK     = 0x08000000;
-        enum SA_RESETHAND   = 0x80000000;
-        enum SA_RESTART     = 0x10000000;
-        enum SA_SIGINFO     = 4;
-        enum SA_NOCLDWAIT   = 2;
-        enum SA_NODEFER     = 0x40000000;
-        enum SS_ONSTACK     = 1;
-        enum SS_DISABLE     = 2;
-        enum MINSIGSTKSZ    = 2048;
-        enum SIGSTKSZ       = 8192;
+    enum SIGPOLL   = 29;
+    enum SIGPROF   = 27;
+    enum SIGSYS    = 31;
+    enum SIGTRAP   = 5;
+    enum SIGVTALRM = 26;
+    enum SIGXCPU   = 24;
+    enum SIGXFSZ   = 25;
 
-        struct stack_t
-        {
-            void*   ss_sp;
-            int     ss_flags;
-            size_t  ss_size;
-        }
-    }
-    else version (AArch64)
-    {
-        enum SIGPOLL   = 29;
-        enum SIGPROF   = 27;
-        enum SIGSYS    = 31;
-        enum SIGTRAP   = 5;
-        enum SIGVTALRM = 26;
-        enum SIGXCPU   = 24;
-        enum SIGXFSZ   = 25;
-
-        enum SA_ONSTACK     = 0x08000000;
-        enum SA_RESETHAND   = 0x80000000;
-        enum SA_RESTART     = 0x10000000;
-        enum SA_SIGINFO     = 4;
-        enum SA_NOCLDWAIT   = 2;
-        enum SA_NODEFER     = 0x40000000;
-        enum SS_ONSTACK     = 1;
-        enum SS_DISABLE     = 2;
-        enum MINSIGSTKSZ    = 2048;
-        enum SIGSTKSZ       = 8192;
+    enum SA_ONSTACK     = 0x08000000;
+    enum SA_RESETHAND   = 0x80000000;
+    enum SA_RESTART     = 0x10000000;
+    enum SA_SIGINFO     = 4;
+    enum SA_NOCLDWAIT   = 2;
+    enum SA_NODEFER     = 0x40000000;
+    enum SS_ONSTACK     = 1;
+    enum SS_DISABLE     = 2;
+    enum MINSIGSTKSZ    = 2048;
+    enum SIGSTKSZ       = 8192;
 
-        struct stack_t
-        {
-            void*   ss_sp;
-            int     ss_flags;
-            size_t  ss_size;
-        }
-    }
-    else
+    struct stack_t
     {
-        static assert(false, "Architecture not supported.");
+        void*   ss_sp;
+        int     ss_flags;
+        size_t  ss_size;
     }
 
     enum
@@ -3560,7 +3483,7 @@ else version (CRuntime_Musl)
         int sigev_notify;
         void function(sigval) sigev_notify_function;
         pthread_attr_t *sigev_notify_attributes;
-        char[56 - 3 * long.sizeof] __pad;
+        char[56 - 3 * long.sizeof] __pad = void;
     }
 }
 else version (CRuntime_UClibc)
diff --git a/libphobos/libdruntime/core/sys/posix/spawn.d b/libphobos/libdruntime/core/sys/posix/spawn.d
new file mode 100644 (file)
index 0000000..f5e6c6d
--- /dev/null
@@ -0,0 +1,371 @@
+/**
+ * D header file for spawn.h.
+ *
+ * Copyright: Copyright (C) 2018 by The D Language Foundation, All Rights Reserved
+ * Authors:   Petar Kirov
+ * License:   $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
+ * Source:    $(LINK2 https://github.com/dlang/druntime/blob/master/src/core/sys/posix/spawn.d, _spawn.d)
+ * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
+ */
+module core.sys.posix.spawn;
+
+/*
+Based on the following system headers:
+
+Glibc: https://sourceware.org/git/?p=glibc.git;a=blob;f=posix/spawn.h;hb=HEAD
+
+Bionic libc: https://android.googlesource.com/platform/bionic.git/+/master/libc/include/spawn.h
+
+Musl libc: https://git.musl-libc.org/cgit/musl/tree/include/spawn.h
+
+uClibc: https://git.uclibc.org/uClibc/tree/include/spawn.h
+
+Darwin XNU:
+https://opensource.apple.com/source/xnu/xnu-4570.71.2/libsyscall/wrappers/spawn/spawn.h.auto.html
+https://opensource.apple.com/source/xnu/xnu-4570.71.2/bsd/sys/spawn.h.auto.html
+https://github.com/opensource-apple/xnu (GitHub mirror)
+
+FreeBSD: https://github.com/freebsd/freebsd/blob/master/include/spawn.h
+
+NetBSD: https://github.com/NetBSD/src/blob/trunk/sys/sys/spawn.h
+
+OpenBSD: https://github.com/openbsd/src/blob/master/include/spawn.h
+
+DragonFlyBSD: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/include/spawn.h
+
+Solaris: https://github.com/illumos/illumos-gate/blob/master/usr/src/head/spawn.h
+*/
+
+version (OSX) // macOS and iOS only as this API is prohibited on WatchOS and TVOS
+    version = Darwin;
+else version (iOS)
+    version = Darwin;
+
+version (Posix):
+public import core.sys.posix.sys.types : mode_t, pid_t;
+public import core.sys.posix.signal : sigset_t;
+public import core.sys.posix.sched : sched_param;
+
+extern(C):
+@nogc:
+nothrow:
+
+int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t*, int);
+int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t*, int, int);
+int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t*, int, const char*, int, mode_t);
+int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t*);
+int posix_spawn_file_actions_init(posix_spawn_file_actions_t*);
+int posix_spawnattr_destroy(posix_spawnattr_t*);
+int posix_spawnattr_getflags(const posix_spawnattr_t*, short*);
+int posix_spawnattr_getpgroup(const posix_spawnattr_t*, pid_t*);
+
+version (Darwin)
+{ } // Not supported
+else
+{
+    int posix_spawnattr_getschedparam(const posix_spawnattr_t*, sched_param*);
+    int posix_spawnattr_getschedpolicy(const posix_spawnattr_t*, int*);
+    int posix_spawnattr_setschedparam(posix_spawnattr_t*, const sched_param*);
+    int posix_spawnattr_setschedpolicy(posix_spawnattr_t*, int);
+}
+
+int posix_spawnattr_getsigdefault(const posix_spawnattr_t*, sigset_t*);
+int posix_spawnattr_getsigmask(const posix_spawnattr_t*, sigset_t*);
+int posix_spawnattr_init(posix_spawnattr_t*);
+int posix_spawnattr_setflags(posix_spawnattr_t*, short);
+int posix_spawnattr_setpgroup(posix_spawnattr_t*, pid_t);
+int posix_spawnattr_setsigdefault(posix_spawnattr_t*, const sigset_t*);
+int posix_spawnattr_setsigmask(posix_spawnattr_t*, const sigset_t*);
+int posix_spawn(pid_t*pid, const char* path,
+                const posix_spawn_file_actions_t* file_actions,
+                const posix_spawnattr_t* attrp,
+                const char** argv, const char** envp);
+int posix_spawnp(pid_t* pid, const char* file,
+                 const posix_spawn_file_actions_t* file_actions,
+                 const posix_spawnattr_t* attrp,
+                 const char** argv, const char** envp);
+
+version (linux)
+{
+    version (CRuntime_Glibc)
+    {
+        // Source: https://sourceware.org/git/?p=glibc.git;a=blob;f=posix/spawn.h;hb=HEAD
+        enum
+        {
+            POSIX_SPAWN_RESETIDS = 0x01,
+            POSIX_SPAWN_SETPGROUP = 0x02,
+            POSIX_SPAWN_SETSIGDEF = 0x04,
+            POSIX_SPAWN_SETSIGMASK = 0x08,
+            POSIX_SPAWN_SETSCHEDPARAM = 0x10,
+            POSIX_SPAWN_SETSCHEDULER = 0x20
+        }
+        import core.sys.posix.config : __USE_GNU;
+        static if (__USE_GNU)
+        {
+            enum
+            {
+                POSIX_SPAWN_USEVFORK = 0x40,
+                POSIX_SPAWN_SETSID = 0x80
+            }
+        }
+        struct posix_spawnattr_t
+        {
+            short __flags;
+            pid_t __pgrp;
+            sigset_t __sd;
+            sigset_t __ss;
+            sched_param __sp;
+            int __policy;
+            int[16] __pad;
+        }
+        struct __spawn_action;
+        struct posix_spawn_file_actions_t
+        {
+            int __allocated;
+            int __used;
+            __spawn_action* __actions;
+            int[16] __pad;
+        }
+    }
+    else version (CRuntime_Bionic)
+    {
+        // Source: https://android.googlesource.com/platform/bionic.git/+/master/libc/include/spawn.h
+        enum
+        {
+            POSIX_SPAWN_RESETIDS = 1,
+            POSIX_SPAWN_SETPGROUP = 2,
+            POSIX_SPAWN_SETSIGDEF = 4,
+            POSIX_SPAWN_SETSIGMASK = 8,
+            POSIX_SPAWN_SETSCHEDPARAM = 16,
+            POSIX_SPAWN_SETSCHEDULER = 32
+        }
+        import core.sys.posix.config : __USE_GNU;
+        static if (__USE_GNU)
+        {
+            enum
+            {
+                POSIX_SPAWN_USEVFORK = 64,
+                POSIX_SPAWN_SETSID = 128
+            }
+        }
+        alias posix_spawnattr_t = __posix_spawnattr*;
+        alias posix_spawn_file_actions_t = __posix_spawn_file_actions*;
+        struct __posix_spawnattr;
+        struct __posix_spawn_file_actions;
+    }
+    else version (CRuntime_Musl)
+    {
+        // Source: https://git.musl-libc.org/cgit/musl/tree/include/spawn.h
+        enum
+        {
+            POSIX_SPAWN_RESETIDS = 1,
+            POSIX_SPAWN_SETPGROUP = 2,
+            POSIX_SPAWN_SETSIGDEF = 4,
+            POSIX_SPAWN_SETSIGMASK = 8,
+            POSIX_SPAWN_SETSCHEDPARAM = 16,
+            POSIX_SPAWN_SETSCHEDULER = 32,
+            POSIX_SPAWN_USEVFORK = 64,
+            POSIX_SPAWN_SETSID = 128
+        }
+        struct posix_spawnattr_t
+        {
+            int __flags;
+            pid_t __pgrp;
+            sigset_t __def, __mask;
+            int __prio, __pol;
+            void* __fn;
+            char[64 - (void*).sizeof] __pad = void;
+        }
+        struct posix_spawn_file_actions_t
+        {
+            int[2] __pad0;
+            void* __actions;
+            int[16] __pad;
+        }
+    }
+    else version (CRuntime_UClibc)
+    {
+        // Source: https://git.uclibc.org/uClibc/tree/include/spawn.h
+        enum
+        {
+            POSIX_SPAWN_RESETIDS = 0x01,
+            POSIX_SPAWN_SETPGROUP = 0x02,
+            POSIX_SPAWN_SETSIGDEF = 0x04,
+            POSIX_SPAWN_SETSIGMASK = 0x08,
+            POSIX_SPAWN_SETSCHEDPARAM = 0x10,
+            POSIX_SPAWN_SETSCHEDULER = 0x20
+        }
+        import core.sys.posix.config : __USE_GNU;
+        static if (__USE_GNU)
+        {
+            enum
+            {
+                POSIX_SPAWN_USEVFORK = 0x40,
+            }
+        }
+        struct posix_spawnattr_t
+        {
+            short __flags;
+            pid_t __pgrp;
+            sigset_t __sd;
+            sigset_t __ss;
+            sched_param __sp;
+            int __policy;
+            int[16] __pad;
+        }
+        struct __spawn_action;
+        struct posix_spawn_file_actions_t
+        {
+            int __allocated;
+            int __used;
+            __spawn_action* __actions;
+            int[16] __pad;
+        }
+    }
+    else
+        static assert(0, "Unsupported Linux libc");
+}
+else version (Darwin)
+{
+    // Sources:
+    // https://opensource.apple.com/source/xnu/xnu-4570.71.2/libsyscall/wrappers/spawn/spawn.h.auto.html
+    // https://opensource.apple.com/source/xnu/xnu-4570.71.2/bsd/sys/spawn.h.auto.html
+    enum
+    {
+        POSIX_SPAWN_RESETIDS = 0x01,
+        POSIX_SPAWN_SETPGROUP = 0x02,
+        POSIX_SPAWN_SETSIGDEF = 0x04,
+        POSIX_SPAWN_SETSIGMASK = 0x08,
+        // POSIX_SPAWN_SETSCHEDPARAM = 0x10,  // not supported
+        // POSIX_SPAWN_SETSCHEDULER = 0x20,   // ditto
+        POSIX_SPAWN_SETEXEC = 0x40,
+        POSIX_SPAWN_START_SUSPENDED = 0x80
+    }
+    alias posix_spawnattr_t = void*;
+    alias posix_spawn_file_actions_t = void*;
+}
+else version (FreeBSD)
+{
+    // Source: https://github.com/freebsd/freebsd/blob/master/include/spawn.h
+    enum
+    {
+        POSIX_SPAWN_RESETIDS = 0x01,
+        POSIX_SPAWN_SETPGROUP = 0x02,
+        POSIX_SPAWN_SETSCHEDPARAM = 0x04,
+        POSIX_SPAWN_SETSCHEDULER = 0x08,
+        POSIX_SPAWN_SETSIGDEF = 0x10,
+        POSIX_SPAWN_SETSIGMASK = 0x20
+    }
+    alias posix_spawnattr_t =  void*;
+    alias posix_spawn_file_actions_t =  void*;
+}
+else version (NetBSD)
+{
+    // Source: https://github.com/NetBSD/src/blob/trunk/sys/sys/spawn.h
+    enum
+    {
+        POSIX_SPAWN_RESETIDS = 0x01,
+        POSIX_SPAWN_SETPGROUP = 0x02,
+        POSIX_SPAWN_SETSCHEDPARAM = 0x04,
+        POSIX_SPAWN_SETSCHEDULER = 0x08,
+        POSIX_SPAWN_SETSIGDEF = 0x10,
+        POSIX_SPAWN_SETSIGMASK = 0x20,
+        POSIX_SPAWN_RETURNERROR = 0x40 // NetBSD specific
+    }
+    struct posix_spawnattr
+    {
+        short sa_flags;
+        pid_t sa_pgroup;
+        sched_param sa_schedparam;
+        int sa_schedpolicy;
+        sigset_t sa_sigdefault;
+        sigset_t sa_sigmask;
+    }
+    struct posix_spawn_file_actions_entry_t;
+    struct posix_spawn_file_actions
+    {
+        uint size;
+        uint len;
+        posix_spawn_file_actions_entry_t* fae;
+    }
+}
+else version (OpenBSD)
+{
+    // Source: https://github.com/openbsd/src/blob/master/include/spawn.h
+    enum
+    {
+        POSIX_SPAWN_RESETIDS = 0x01,
+        POSIX_SPAWN_SETPGROUP = 0x02,
+        POSIX_SPAWN_SETSCHEDPARAM = 0x04,
+        POSIX_SPAWN_SETSCHEDULER = 0x08,
+        POSIX_SPAWN_SETSIGDEF = 0x10,
+        POSIX_SPAWN_SETSIGMASK = 0x20
+    }
+    alias posix_spawnattr_t = __posix_spawnattr*;
+    alias posix_spawn_file_actions_t = __posix_spawn_file_actions*;
+    struct __posix_spawnattr;
+    struct __posix_spawn_file_actions;
+}
+else version (DragonFlyBSD)
+{
+    // Source: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/include/spawn.h
+    enum
+    {
+        POSIX_SPAWN_RESETIDS = 0x01,
+        POSIX_SPAWN_SETPGROUP = 0x02,
+        POSIX_SPAWN_SETSCHEDPARAM = 0x04,
+        POSIX_SPAWN_SETSCHEDULER = 0x08,
+        POSIX_SPAWN_SETSIGDEF = 0x10,
+        POSIX_SPAWN_SETSIGMASK = 0x20
+    }
+    alias posix_spawnattr_t = __posix_spawnattr*;
+    alias posix_spawn_file_actions_t = __posix_spawn_file_actions*;
+    struct __posix_spawnattr;
+    struct __posix_spawn_file_actions;
+}
+else version (Solaris)
+{
+    // Source: https://github.com/illumos/illumos-gate/blob/master/usr/src/head/spawn.h
+    enum
+    {
+        POSIX_SPAWN_RESETIDS = 0x01,
+        POSIX_SPAWN_SETPGROUP = 0x02,
+        POSIX_SPAWN_SETSIGDEF = 0x04,
+        POSIX_SPAWN_SETSIGMASK = 0x08,
+        POSIX_SPAWN_SETSCHEDPARAM = 0x10,
+        POSIX_SPAWN_SETSCHEDULER = 0x20,
+    }
+    version (none)
+    {
+        // Non-portable Solaris extensions.
+        enum
+        {
+            POSIX_SPAWN_SETSIGIGN_NP = 0x0800,
+            POSIX_SPAWN_NOSIGCHLD_NP = 0x1000,
+            POSIX_SPAWN_WAITPID_NP = 0x2000,
+            POSIX_SPAWN_NOEXECERR_NP = 0x4000,
+        }
+    }
+    struct posix_spawnattr_t
+    {
+        void* __spawn_attrp;
+    }
+    struct posix_spawn_file_actions_t
+    {
+        void* __file_attrp;
+    }
+    version (none)
+    {
+        // Non-portable Solaris extensions.
+        alias boolean_t = int;
+        int posix_spawn_file_actions_addclosefrom_np(posix_spawn_file_actions_t* file_actions,
+                                                     int lowfiledes);
+        int posix_spawn_pipe_np(pid_t* pidp, int* fdp, const char* cmd, boolean_t write,
+                                posix_spawn_file_actions_t* fact,
+                                posix_spawnattr_t* attr);
+        int posix_spawnattr_getsigignore_np(const posix_spawnattr_t* attr, sigset_t* sigignore);
+        int posix_spawnattr_setsigignore_np(posix_spawnattr_t* attr, const sigset_t* sigignore);
+    }
+}
+else
+    static assert(0, "Unsupported OS");
index f9f17e0c6e05f7ed510a772bd634dc3095f7cebc..095c81ba41c25c062b858e443734839aa0ffcd02 100644 (file)
@@ -176,21 +176,22 @@ else version (DragonFlyBSD)
 }
 else version (CRuntime_Bionic)
 {
-    // All except ftok are from the linux kernel headers.
-    version (X86)
+    // All except ftok are from the linux kernel headers. Latest Bionic headers
+    // don't use this legacy definition anymore, consider updating.
+    version (D_LP64)
     {
         struct ipc_perm
         {
             key_t   key;
-            ushort  uid;
-            ushort  gid;
-            ushort  cuid;
-            ushort  cgid;
+            uint    uid;
+            uint    gid;
+            uint    cuid;
+            uint    cgid;
             mode_t  mode;
             ushort  seq;
         }
     }
-    else version (ARM)
+    else
     {
         struct ipc_perm
         {
@@ -203,23 +204,6 @@ else version (CRuntime_Bionic)
             ushort  seq;
         }
     }
-    else version (AArch64)
-    {
-        struct ipc_perm
-        {
-            key_t   key;
-            uint    uid;
-            uint    gid;
-            uint    cuid;
-            uint    cgid;
-            mode_t  mode;
-            ushort  seq;
-        }
-    }
-    else
-    {
-        static assert(false, "Architecture not supported.");
-    }
 
     enum IPC_CREAT      = 0x0200; // 01000
     enum IPC_EXCL       = 0x0400; // 02000
index c08ba009f834e7a78bf389ff78e776b6df41ba3f..c0bee5528928a75e5031cf3649ac623a24bad1c2 100644 (file)
@@ -458,23 +458,7 @@ else version (CRuntime_Bionic)
     enum MAP_SHARED     = 0x0001;
     enum MAP_PRIVATE    = 0x0002;
     enum MAP_FIXED      = 0x0010;
-
-    version (X86)
-    {
-        enum MAP_ANON       = 0x0020;
-    }
-    else version (ARM)
-    {
-        enum MAP_ANON       = 0x0020;
-    }
-    else version (AArch64)
-    {
-        enum MAP_ANON       = 0x0020;
-    }
-    else
-    {
-        static assert(false, "Architecture not supported.");
-    }
+    enum MAP_ANON       = 0x0020;
 
     enum MAP_FAILED     = cast(void*)-1;
 
index 1957debbda77ee3ec906f5718e0111856a639c77..208e5c2dd47f85dc13c6ae81e642471559b87a9d 100644 (file)
@@ -196,7 +196,7 @@ else
 struct msgbuf
 {
     c_long mtype;
-    char[1] mtext;
+    char[1] mtext = 0;
 }
 
 int msgctl(int msqid, int cmd, msqid_ds* __buf);
index dca526563cd5be8c0a29592e57509c6d1c096815..87491fa699bdcb87909e9d2c69b328e7f2a82219 100644 (file)
@@ -466,6 +466,38 @@ else version (CRuntime_Bionic)
 else version (CRuntime_Musl)
 {
     alias ulong rlim_t;
+
+    int getrlimit(int, rlimit*);
+    int setrlimit(int, in rlimit*);
+    alias getrlimit getrlimit64;
+    alias setrlimit setrlimit64;
+    enum
+    {
+        RUSAGE_SELF = 0,
+        RUSAGE_CHILDREN = -1,
+        RUSAGE_THREAD = 1
+    }
+    struct rusage
+    {
+        timeval ru_utime;
+        timeval ru_stime;
+        c_long ru_maxrss;
+        c_long ru_ixrss;
+        c_long ru_idrss;
+        c_long ru_isrss;
+        c_long ru_minflt;
+        c_long ru_majflt;
+        c_long ru_nswap;
+        c_long ru_inblock;
+        c_long ru_oublock;
+        c_long ru_msgsnd;
+        c_long ru_msgrcv;
+        c_long ru_nsignals;
+        c_long ru_nvcsw;
+        c_long ru_nivcsw;
+        c_long[16] __reserved;
+    }
+
     enum
     {
         RLIMIT_CPU    = 0,
@@ -476,10 +508,6 @@ else version (CRuntime_Musl)
         RLIMIT_NOFILE = 7,
         RLIMIT_AS     = 9,
     }
-    int getrlimit(int, rlimit*);
-    int setrlimit(int, in rlimit*);
-    alias getrlimit getrlimit64;
-    alias setrlimit setrlimit64;
 }
 else version (CRuntime_UClibc)
 {
index 6a3f708ed815635bbb060fba0bdd7517f48d5253..d1ebad7318ae0689ff8a4186f182a8e473504f62 100644 (file)
@@ -1430,7 +1430,7 @@ else version (Solaris)
     struct sockaddr
     {
         sa_family_t sa_family;
-        char[14] sa_data;
+        char[14] sa_data = 0;
     }
 
     alias double sockaddr_maxalign_t;
@@ -1446,9 +1446,9 @@ else version (Solaris)
     struct sockaddr_storage
     {
          sa_family_t ss_family;
-         char[_SS_PAD1SIZE] _ss_pad1;
+         char[_SS_PAD1SIZE] _ss_pad1 = void;
          sockaddr_maxalign_t _ss_align;
-         char[_SS_PAD2SIZE] _ss_pad2;
+         char[_SS_PAD2SIZE] _ss_pad2 = void;
     }
 
     struct msghdr
@@ -1644,117 +1644,38 @@ else version (CRuntime_Bionic)
         int             cmsg_type;
     }
 
-    version (X86)
-    {
-        alias uint __kernel_size_t;
-
-        enum
-        {
-            SOCK_DGRAM      = 2,
-            SOCK_SEQPACKET  = 5,
-            SOCK_STREAM     = 1
-        }
+    alias size_t __kernel_size_t;
 
-        enum
-        {
-            SOL_SOCKET      = 1
-        }
-
-        enum
-        {
-            SO_ACCEPTCONN   = 30,
-            SO_BROADCAST    = 6,
-            SO_DEBUG        = 1,
-            SO_DONTROUTE    = 5,
-            SO_ERROR        = 4,
-            SO_KEEPALIVE    = 9,
-            SO_LINGER       = 13,
-            SO_OOBINLINE    = 10,
-            SO_RCVBUF       = 8,
-            SO_RCVLOWAT     = 18,
-            SO_RCVTIMEO     = 20,
-            SO_REUSEADDR    = 2,
-            SO_SNDBUF       = 7,
-            SO_SNDLOWAT     = 19,
-            SO_SNDTIMEO     = 21,
-            SO_TYPE         = 3
-        }
-    }
-    else version (ARM)
+    enum
     {
-        alias uint __kernel_size_t;
-
-        enum
-        {
-            SOCK_DGRAM      = 2,
-            SOCK_SEQPACKET  = 5,
-            SOCK_STREAM     = 1
-        }
-
-        enum
-        {
-            SOL_SOCKET      = 1
-        }
-
-        enum
-        {
-            SO_ACCEPTCONN   = 30,
-            SO_BROADCAST    = 6,
-            SO_DEBUG        = 1,
-            SO_DONTROUTE    = 5,
-            SO_ERROR        = 4,
-            SO_KEEPALIVE    = 9,
-            SO_LINGER       = 13,
-            SO_OOBINLINE    = 10,
-            SO_RCVBUF       = 8,
-            SO_RCVLOWAT     = 18,
-            SO_RCVTIMEO     = 20,
-            SO_REUSEADDR    = 2,
-            SO_SNDBUF       = 7,
-            SO_SNDLOWAT     = 19,
-            SO_SNDTIMEO     = 21,
-            SO_TYPE         = 3
-        }
+        SOCK_DGRAM      = 2,
+        SOCK_SEQPACKET  = 5,
+        SOCK_STREAM     = 1
     }
-    else version (AArch64)
-    {
-        alias ulong __kernel_size_t;
-
-        enum
-        {
-            SOCK_DGRAM      = 2,
-            SOCK_SEQPACKET  = 5,
-            SOCK_STREAM     = 1
-        }
 
-        enum
-        {
-            SOL_SOCKET      = 1
-        }
-
-        enum
-        {
-            SO_ACCEPTCONN   = 30,
-            SO_BROADCAST    = 6,
-            SO_DEBUG        = 1,
-            SO_DONTROUTE    = 5,
-            SO_ERROR        = 4,
-            SO_KEEPALIVE    = 9,
-            SO_LINGER       = 13,
-            SO_OOBINLINE    = 10,
-            SO_RCVBUF       = 8,
-            SO_RCVLOWAT     = 18,
-            SO_RCVTIMEO     = 20,
-            SO_REUSEADDR    = 2,
-            SO_SNDBUF       = 7,
-            SO_SNDLOWAT     = 19,
-            SO_SNDTIMEO     = 21,
-            SO_TYPE         = 3
-        }
+    enum
+    {
+        SOL_SOCKET      = 1
     }
-    else
+
+    enum
     {
-        static assert(false, "Architecture not supported.");
+        SO_ACCEPTCONN   = 30,
+        SO_BROADCAST    = 6,
+        SO_DEBUG        = 1,
+        SO_DONTROUTE    = 5,
+        SO_ERROR        = 4,
+        SO_KEEPALIVE    = 9,
+        SO_LINGER       = 13,
+        SO_OOBINLINE    = 10,
+        SO_RCVBUF       = 8,
+        SO_RCVLOWAT     = 18,
+        SO_RCVTIMEO     = 20,
+        SO_REUSEADDR    = 2,
+        SO_SNDBUF       = 7,
+        SO_SNDLOWAT     = 19,
+        SO_SNDTIMEO     = 21,
+        SO_TYPE         = 3
     }
 
     enum
index 8c78ba677a419b2c92b1ff07af598caadec42958..53858e713bb6917820816e582e8e1d23dfb7fe73 100644 (file)
@@ -453,26 +453,84 @@ version (CRuntime_Glibc)
     }
     else version (RISCV_Any)
     {
+        private
+        {
+            alias __dev_t = ulong;
+            alias __ino_t = c_ulong;
+            alias __ino64_t = ulong;
+            alias __mode_t = uint;
+            alias __nlink_t = uint;
+            alias __uid_t = uint;
+            alias __gid_t = uint;
+            alias __off_t = c_long;
+            alias __off64_t = long;
+            alias __blksize_t = int;
+            alias __blkcnt_t = c_long;
+            alias __blkcnt64_t = long;
+            alias __timespec = timespec;
+            alias __time_t = time_t;
+        }
         struct stat_t
         {
-            dev_t       st_dev;
-            ino_t       st_ino;
-            mode_t      st_mode;
-            nlink_t     st_nlink;
-            uid_t       st_uid;
-            gid_t       st_gid;
-            dev_t       st_rdev;
-            dev_t       __pad1;
-            off_t       st_size;
-            blksize_t   st_blksize;
-            int         __pad2;
-            time_t      st_atime;
-            c_ulong     st_atime_nsec;
-            time_t      st_mtime;
-            c_ulong     st_mtime_nsec;
-            time_t      st_ctime;
-            c_ulong     st_ctime_nsec;
-            int[2]      __reserved;
+            __dev_t st_dev;
+
+            static if (__USE_FILE_OFFSET64)
+            {
+                __ino64_t st_ino;
+            }
+            else
+            {
+                __ino_t st_ino;
+            }
+            __mode_t st_mode;
+            __nlink_t st_nlink;
+            __uid_t st_uid;
+            __gid_t st_gid;
+            __dev_t st_rdev;
+            __dev_t __pad1;
+
+            static if (__USE_FILE_OFFSET64)
+            {
+                __off64_t st_size;
+            }
+            else
+            {
+                __off_t st_size;
+            }
+            __blksize_t st_blksize;
+            int __pad2;
+
+            static if (__USE_FILE_OFFSET64)
+            {
+                __blkcnt64_t st_blocks;
+            }
+            else
+            {
+                __blkcnt_t st_blocks;
+            }
+
+            static if (__USE_MISC)
+            {
+                __timespec st_atim;
+                __timespec st_mtim;
+                __timespec st_ctim;
+                extern(D)
+                {
+                    @property ref time_t st_atime() { return st_atim.tv_sec; }
+                    @property ref time_t st_mtime() { return st_mtim.tv_sec; }
+                    @property ref time_t st_ctime() { return st_ctim.tv_sec; }
+                }
+            }
+            else
+            {
+                __time_t st_atime;
+                c_ulong st_atimensec;
+                __time_t st_mtime;
+                c_ulong st_mtimensec;
+                __time_t st_ctime;
+                c_ulong st_ctimensec;
+            }
+            int[2] __unused;
         }
     }
     else version (ARM)
@@ -1161,7 +1219,7 @@ else version (Solaris)
             }
             blksize_t st_blksize;
             blkcnt_t st_blocks;
-            char[_ST_FSTYPSZ] st_fstype;
+            char[_ST_FSTYPSZ] st_fstype = 0;
         }
 
         static if (__USE_LARGEFILE64) alias stat_t stat64_t;
@@ -1198,7 +1256,7 @@ else version (Solaris)
             }
             blksize_t st_blksize;
             blkcnt_t st_blocks;
-            char[_ST_FSTYPSZ] st_fstype;
+            char[_ST_FSTYPSZ] st_fstype = 0;
             c_long[8] st_pad4;
         }
 
@@ -1232,7 +1290,7 @@ else version (Solaris)
             }
             blksize_t st_blksize;
             blkcnt64_t st_blocks;
-            char[_ST_FSTYPSZ] st_fstype;
+            char[_ST_FSTYPSZ] st_fstype = 0;
             c_long[8] st_pad4;
         }
 
@@ -1361,6 +1419,31 @@ else version (CRuntime_Bionic)
             uint        __unused5;
         }
     }
+    else version (X86_64)
+    {
+        struct stat_t
+        {
+            ulong       st_dev;
+            ulong       st_ino;
+            ulong       st_nlink;
+            uint        st_mode;
+            uid_t       st_uid;
+            gid_t       st_gid;
+            uint        __pad0;
+
+            ulong       st_rdev;
+            long        st_size;
+            long        st_blksize;
+            long        st_blocks;
+            long        st_atime;
+            ulong       st_atime_nsec;
+            long        st_mtime;
+            ulong       st_mtime_nsec;
+            long        st_ctime;
+            ulong       st_ctime_nsec;
+            long[3]     __pad3;
+        }
+    }
     else
     {
         static assert(false, "Architecture not supported.");
@@ -1445,11 +1528,11 @@ else version (CRuntime_Musl)
         timespec st_atim;
         timespec st_mtim;
         timespec st_ctim;
-        extern(D) @safe @property
+        extern(D) @safe @property inout pure nothrow
         {
-            ref time_t st_atime() return { return st_atim.tv_sec; }
-            ref time_t st_mtime() return { return st_mtim.tv_sec; }
-            ref time_t st_ctime() return { return st_ctim.tv_sec; }
+            ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
+            ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
+            ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
         }
         long[3] __unused;
     }
index 4f69b61656db6fa6cd67d34d4004793b4c770c43..9828c7b76e7373a1f251b39bc11e9e6a720d44c0 100644 (file)
@@ -119,9 +119,9 @@ else version (NetBSD)
         c_ulong f_namemax;
         int f_owner;
         int[4] f_spare;
-        char[_VFS_NAMELEN] f_fstypename;
-        char[_VFS_MNAMELEN] f_mntonname;
-        char[_VFS_MNAMELEN] f_mntfromname;
+        char[_VFS_NAMELEN] f_fstypename = 0;
+        char[_VFS_MNAMELEN] f_mntonname = 0;
+        char[_VFS_MNAMELEN] f_mntfromname = 0;
     }
 
     enum FFlag
index 53c78735bb71fd8b149004d8f79dcd56950be246..060b56f88c8043855cb56fc5cd994884bce6d482 100644 (file)
@@ -247,34 +247,15 @@ else version (CRuntime_Bionic)
     alias c_long    time_t;
     alias uint      uid_t;
 
-    version (X86)
-    {
-        alias ushort    mode_t;
-        alias ushort    nlink_t;
-    }
-    else version (X86_64)
-    {
-        alias ushort    mode_t;
-        alias uint      nlink_t;
-    }
-    else version (ARM)
-    {
-        alias ushort    mode_t;
-        alias ushort    nlink_t;
-    }
-    else version (AArch64)
-    {
-        alias uint      mode_t;
-        alias uint      nlink_t;
-    }
-    else version (MIPS32)
+    version (D_LP64)
     {
         alias uint      mode_t;
         alias uint      nlink_t;
     }
     else
     {
-        static assert(false, "Architecture not supported.");
+        alias ushort    mode_t;
+        alias ushort    nlink_t;
     }
 }
 else version (CRuntime_UClibc)
@@ -1068,7 +1049,7 @@ else version (CRuntime_Bionic)
         size_t  guard_size;
         int     sched_policy;
         int     sched_priority;
-        version (D_LP64) char[16] __reserved;
+        version (D_LP64) char[16] __reserved = 0;
     }
 
     struct pthread_cond_t
index 9d0d5ce7db435297c19370558a87c2b8537927e2..8a5dd0564d400c94ab148f27c3a4d28b76fd1481 100644 (file)
@@ -23,15 +23,15 @@ version (CRuntime_Glibc)
 
     struct utsname
     {
-        char[utsNameLength] sysname;
-        char[utsNameLength] nodename;
-        char[utsNameLength] release;
-        char[utsNameLength] version_;
+        char[utsNameLength] sysname = 0;
+        char[utsNameLength] nodename = 0;
+        char[utsNameLength] release = 0;
+        char[utsNameLength] version_ = 0;
         // TODO Deprecate after version_ has been in an official release.
         alias update = version_;
-        char[utsNameLength] machine;
+        char[utsNameLength] machine = 0;
 
-        char[utsNameLength] __domainname;
+        char[utsNameLength] __domainname = 0;
     }
 
     int uname(utsname* __name);
@@ -42,13 +42,13 @@ else version (Darwin)
 
     struct utsname
     {
-        char[utsNameLength] sysname;
-        char[utsNameLength] nodename;
-        char[utsNameLength] release;
-        char[utsNameLength] version_;
+        char[utsNameLength] sysname = 0;
+        char[utsNameLength] nodename = 0;
+        char[utsNameLength] release = 0;
+        char[utsNameLength] version_ = 0;
         // TODO Deprecate after version_ has been in an official release.
         alias update = version_;
-        char[utsNameLength] machine;
+        char[utsNameLength] machine = 0;
     }
 
     int uname(utsname* __name);
@@ -60,13 +60,13 @@ else version (FreeBSD)
 
     struct utsname
     {
-        char[SYS_NMLN] sysname;
-        char[SYS_NMLN] nodename;
-        char[SYS_NMLN] release;
-        char[SYS_NMLN] version_;
+        char[SYS_NMLN] sysname = 0;
+        char[SYS_NMLN] nodename = 0;
+        char[SYS_NMLN] release = 0;
+        char[SYS_NMLN] version_ = 0;
         // TODO Deprecate after version_ has been in an official release.
         alias update = version_;
-        char[SYS_NMLN] machine;
+        char[SYS_NMLN] machine = 0;
     }
 
     int __xuname(int, void*);
@@ -78,13 +78,13 @@ else version (NetBSD)
 
     struct utsname
     {
-        char[utsNameLength] sysname;
-        char[utsNameLength] nodename;
-        char[utsNameLength] release;
-        char[utsNameLength] version_;
+        char[utsNameLength] sysname = 0;
+        char[utsNameLength] nodename = 0;
+        char[utsNameLength] release = 0;
+        char[utsNameLength] version_ = 0;
         // TODO Deprecate after version_ has been in an official release.
         alias update = version_;
-        char[utsNameLength] machine;
+        char[utsNameLength] machine = 0;
     }
 
     int uname(utsname* __name);
@@ -95,13 +95,13 @@ else version (DragonFlyBSD)
 
     struct utsname
     {
-        char[utsNameLength] sysname;
-        char[utsNameLength] nodename;
-        char[utsNameLength] release;
-        char[utsNameLength] version_;
+        char[utsNameLength] sysname = 0;
+        char[utsNameLength] nodename = 0;
+        char[utsNameLength] release = 0;
+        char[utsNameLength] version_ = 0;
         // TODO Deprecate after version_ has been in an official release.
         alias update = version_;
-        char[utsNameLength] machine;
+        char[utsNameLength] machine = 0;
     }
 
     int uname(utsname* __name);
@@ -112,12 +112,12 @@ else version (Solaris)
 
     struct utsname
     {
-        char[SYS_NMLN] sysname;
-        char[SYS_NMLN] nodename;
-        char[SYS_NMLN] release;
+        char[SYS_NMLN] sysname = 0;
+        char[SYS_NMLN] nodename = 0;
+        char[SYS_NMLN] release = 0;
         // The field name is version but version is a keyword in D.
-        char[SYS_NMLN] _version;
-        char[SYS_NMLN] machine;
+        char[SYS_NMLN] _version = 0;
+        char[SYS_NMLN] machine = 0;
     }
 
     int uname(utsname* __name);
@@ -128,13 +128,13 @@ else version (CRuntime_Bionic)
 
     struct utsname
     {
-        char[SYS_NMLN] sysname;
-        char[SYS_NMLN] nodename;
-        char[SYS_NMLN] release;
+        char[SYS_NMLN] sysname = 0;
+        char[SYS_NMLN] nodename = 0;
+        char[SYS_NMLN] release = 0;
         // The field name is version but version is a keyword in D.
-        char[SYS_NMLN] _version;
-        char[SYS_NMLN] machine;
-        char[SYS_NMLN] domainname;
+        char[SYS_NMLN] _version = 0;
+        char[SYS_NMLN] machine = 0;
+        char[SYS_NMLN] domainname = 0;
     }
 
     int uname(utsname*);
@@ -145,12 +145,12 @@ else version (CRuntime_Musl)
 
     struct utsname
     {
-        char[SYS_NMLN] sysname;
-        char[SYS_NMLN] nodename;
-        char[SYS_NMLN] release;
-        char[SYS_NMLN] _version;
-        char[SYS_NMLN] machine;
-        char[SYS_NMLN] domainname;
+        char[SYS_NMLN] sysname = 0;
+        char[SYS_NMLN] nodename = 0;
+        char[SYS_NMLN] release = 0;
+        char[SYS_NMLN] _version = 0;
+        char[SYS_NMLN] machine = 0;
+        char[SYS_NMLN] domainname = 0;
     }
 
     int uname(utsname*);
@@ -161,12 +161,12 @@ else version (CRuntime_UClibc)
 
     struct utsname
     {
-        char[utsNameLength] sysname;
-        char[utsNameLength] nodename;
-        char[utsNameLength] release;
-        char[utsNameLength] version_;
-        char[utsNameLength] machine;
-        char[utsNameLength] domainname;
+        char[utsNameLength] sysname = 0;
+        char[utsNameLength] nodename = 0;
+        char[utsNameLength] release = 0;
+        char[utsNameLength] version_ = 0;
+        char[utsNameLength] machine = 0;
+        char[utsNameLength] domainname = 0;
     }
 
     int uname(utsname*);
index 0a341e50adacf0ad48cd0834d1e68b0701ceaaee..52b168649173b9273c70554d431596d046c8f755 100644 (file)
@@ -431,7 +431,7 @@ version (CRuntime_Glibc)
                 mcontext_t*  uc_regs;
             }
             sigset_t    uc_sigmask;
-            char[mcontext_t.sizeof + 12] uc_reg_space;
+            char[mcontext_t.sizeof + 12] uc_reg_space = 0;
         }
     }
     else version (PPC64)
@@ -632,7 +632,7 @@ version (CRuntime_Glibc)
             ucontext_t* uc_link;
             stack_t     uc_stack;
             sigset_t    uc_sigmask;
-            char[1024 / 8 - sigset_t.sizeof] __reserved;
+            char[1024 / 8 - sigset_t.sizeof] __reserved = 0;
             mcontext_t  uc_mcontext;
         }
     }
index c0312fc2b66528887e66649c81e9c9c4182aa4bb..7da26317d356f52766c84cc1e6cbeb9049d87f69 100644 (file)
@@ -29,7 +29,7 @@ enum EI_NIDENT = 16;
 
 struct Elf32_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf32_Half    e_type;
     Elf32_Half    e_machine;
     Elf32_Word    e_version;
@@ -47,7 +47,7 @@ struct Elf32_Ehdr
 
 struct Elf64_Ehdr
 {
-    char[EI_NIDENT] e_ident;
+    char[EI_NIDENT] e_ident = 0;
     Elf64_Half    e_type;
     Elf64_Half    e_machine;
     Elf64_Word    e_version;
index 81b8bbb7fa17d120d2765ab9f90c9ca59ab3df4a..bfbf3ee2abc7f4c47f6e58cba89f4df22118e42c 100644 (file)
@@ -59,7 +59,7 @@ enum PC_SETPRIO      = 1;
 struct pcinfo_t
 {
     id_t                pc_cid;     // class id
-    char[PC_CLNMSZ]     pc_clname;  // class name
+    char[PC_CLNMSZ]     pc_clname=0;// class name
     int[PC_CLINFOSZ]    pc_clinfo;  // class information
 }
 
index ed05161bb02534787168c7327923e34bcf3531fa..762a4dbed0c90144934e0eca83e08a4f5c4e5fd8 100644 (file)
@@ -13,7 +13,7 @@ version (Windows):
 version (ANSI) {} else version = Unicode;
 pragma(lib, "advapi32");
 
-import core.sys.windows.windows, core.sys.windows.accctrl;
+import core.sys.windows.accctrl, core.sys.windows.basetyps, core.sys.windows.w32api, core.sys.windows.winnt;
 
 extern (Windows) {
     VOID BuildExplicitAccessWithNameA(PEXPLICIT_ACCESS_A, LPSTR, DWORD,
index 15b3d9db079379e58e21adfd1d92e8cfc62557f8..34aeccc946bb7574832a9906779b7d4ba36f1e0a 100644 (file)
@@ -4,7 +4,7 @@ version (Windows):
 pragma(lib,"uuid");
 
 import core.atomic;
-import core.sys.windows.windows;
+import core.sys.windows.windef /+: HRESULT, LONG, ULONG+/;
 //import std.string;
 
 public import core.sys.windows.basetyps : GUID, IID, CLSID;
index 36c6a9125cbac5aa1307a2f355d090cd273ba229..e6ef421a54899229aa697b6b645f50201258b9a0 100644 (file)
@@ -10,7 +10,7 @@
 module core.sys.windows.comcat;
 version (Windows):
 
-import core.sys.windows.windows, core.sys.windows.ole2;
+import core.sys.windows.ole2;
 private import core.sys.windows.basetyps, core.sys.windows.cguid, core.sys.windows.objbase, core.sys.windows.unknwn,
   core.sys.windows.windef, core.sys.windows.wtypes;
 
@@ -31,7 +31,7 @@ alias IsEqualGUID IsEqualCATID;
 struct CATEGORYINFO {
     CATID        catid;
     LCID         lcid;
-    OLECHAR[128] szDescription;
+    OLECHAR[128] szDescription = 0;
 }
 alias CATEGORYINFO* LPCATEGORYINFO;
 
index 9d1dfd8817954ef3c6dbb259a2b1af736edbc528..bedf36567e1017458befc30d5cfe5c1c5180fb26 100644 (file)
@@ -2185,7 +2185,7 @@ static if (_WIN32_IE >= 0x400) {
 }
 
 enum {
-    DTM_FIRST         = 0x10000,
+    DTM_FIRST         = 0x1000,
     DTM_GETSYSTEMTIME = 0x1001,
     DTM_SETSYSTEMTIME = 0x1002,
     DTM_GETRANGE      = 0x1003,
@@ -2832,14 +2832,14 @@ static if (_WIN32_IE >= 0x400) {
     struct NMCBEDRAGBEGINW {
         NMHDR hdr;
         int   iItemid;
-        WCHAR[CBEMAXSTRLEN] szText;
+        WCHAR[CBEMAXSTRLEN] szText = 0;
     }
     alias NMCBEDRAGBEGINW* LPNMCBEDRAGBEGINW, PNMCBEDRAGBEGINW;
 
     struct NMCBEDRAGBEGINA {
         NMHDR hdr;
         int   iItemid;
-        char[CBEMAXSTRLEN] szText;
+        char[CBEMAXSTRLEN] szText = 0;
     }
     alias NMCBEDRAGBEGINA* LPNMCBEDRAGBEGINA, PNMCBEDRAGBEGINA;
 
@@ -2964,7 +2964,7 @@ struct NMCBEENDEDITW {
     NMHDR hdr;
     BOOL  fChanged;
     int   iNewSelection;
-    WCHAR[CBEMAXSTRLEN] szText;
+    WCHAR[CBEMAXSTRLEN] szText = 0;
     int   iWhy;
 }
 alias NMCBEENDEDITW* LPNMCBEENDEDITW, PNMCBEENDEDITW;
@@ -2973,7 +2973,7 @@ struct NMCBEENDEDITA {
     NMHDR hdr;
     BOOL  fChanged;
     int   iNewSelection;
-    char[CBEMAXSTRLEN] szText;
+    char[CBEMAXSTRLEN] szText = 0;
     int   iWhy;
 }
 alias NMCBEENDEDITA* LPNMCBEENDEDITA, PNMCBEENDEDITA;
@@ -3545,7 +3545,7 @@ static if (_WIN32_IE >= 0x300) {
     struct NMTTDISPINFOA {
         NMHDR     hdr;
         LPSTR     lpszText;
-        char[80]  szText;
+        char[80]  szText = 0;
         HINSTANCE hinst;
         UINT      uFlags;
         LPARAM    lParam;
@@ -3554,7 +3554,7 @@ static if (_WIN32_IE >= 0x300) {
     struct NMTTDISPINFOW {
         NMHDR     hdr;
         LPWSTR    lpszText;
-        WCHAR[80] szText;
+        WCHAR[80] szText = 0;
         HINSTANCE hinst;
         UINT      uFlags;
         LPARAM    lParam;
@@ -3563,7 +3563,7 @@ static if (_WIN32_IE >= 0x300) {
     struct NMTTDISPINFOA {
         NMHDR     hdr;
         LPSTR     lpszText;
-        char[80]  szText;
+        char[80]  szText = 0;
         HINSTANCE hinst;
         UINT      uFlags;
     }
@@ -3571,7 +3571,7 @@ static if (_WIN32_IE >= 0x300) {
     struct NMTTDISPINFOW {
         NMHDR     hdr;
         LPWSTR    lpszText;
-        WCHAR[80] szText;
+        WCHAR[80] szText = 0;
         HINSTANCE hinst;
         UINT      uFlags;
     }
@@ -4919,8 +4919,8 @@ static if (_WIN32_WINNT >= 0x501) {
         int  iLink;
         UINT state;
         UINT stateMask;
-        WCHAR[MAX_LINKID_TEXT]  szID;
-        WCHAR[L_MAX_URL_LENGTH] szUrl;
+        WCHAR[MAX_LINKID_TEXT]  szID = 0;
+        WCHAR[L_MAX_URL_LENGTH] szUrl = 0;
     }
     alias LITEM* PLITEM;
 
index 617e202b47b4b000075e62a04f5a2542de4db8fa..823a76bd386edf4c86ea9f7408290b6f9feb99a9 100644 (file)
@@ -54,9 +54,9 @@ align(1):
     DWORD     dwHelpContext;
     LONG_PTR  lData;
     HICON     hIcon;
-    CHAR[32]  szName;
-    CHAR[64]  szInfo;
-    CHAR[128] szHelpFile;
+    CHAR[32]  szName = 0;
+    CHAR[64]  szInfo = 0;
+    CHAR[128] szHelpFile = 0;
 }
 alias NEWCPLINFOA* LPNEWCPLINFOA;
 
@@ -68,9 +68,9 @@ align(1):
     DWORD      dwHelpContext;
     LONG_PTR   lData;
     HICON      hIcon;
-    WCHAR[32]  szName;
-    WCHAR[64]  szInfo;
-    WCHAR[128] szHelpFile;
+    WCHAR[32]  szName = 0;
+    WCHAR[64]  szInfo = 0;
+    WCHAR[128] szHelpFile = 0;
 }
 alias NEWCPLINFOW* LPNEWCPLINFOW;
 
index 4044ec3153c48680a67a070109edd4da991fbb07..3f5284f8854aa06b16c6987ccc3ee857a82d022d 100644 (file)
@@ -25,7 +25,7 @@ enum size_t
 struct CCSTYLEA {
     DWORD           flStyle;
     DWORD           flExtStyle;
-    CHAR[CCHCCTEXT] szText;
+    CHAR[CCHCCTEXT] szText = 0;
     LANGID          lgid;
     WORD            wReserved1;
 }
@@ -34,7 +34,7 @@ alias CCSTYLEA* LPCCSTYLEA;
 struct CCSTYLEW {
     DWORD            flStyle;
     DWORD            flExtStyle;
-    WCHAR[CCHCCTEXT] szText;
+    WCHAR[CCHCCTEXT] szText = 0;
     LANGID           lgid;
     WORD             wReserved1;
 }
@@ -55,15 +55,15 @@ struct CCSTYLEFLAGW {
 alias CCSTYLEFLAGW* LPCCSTYLEFLAGW;
 
 struct CCINFOA {
-    CHAR[CCHCCCLASS]  szClass;
+    CHAR[CCHCCCLASS]  szClass = 0;
     DWORD             flOptions;
-    CHAR[CCHCCDESC]   szDesc;
+    CHAR[CCHCCDESC]   szDesc = 0;
     UINT              cxDefault;
     UINT              cyDefault;
     DWORD             flStyleDefault;
     DWORD             flExtStyleDefault;
     DWORD             flCtrlTypeMask;
-    CHAR[CCHCCTEXT]   szTextDefault;
+    CHAR[CCHCCTEXT]   szTextDefault = 0;
     INT               cStyleFlags;
     LPCCSTYLEFLAGA    aStyleFlags;
     LPFNCCSTYLEA      lpfnStyle;
@@ -74,15 +74,15 @@ struct CCINFOA {
 alias CCINFOA* LPCCINFOA;
 
 struct CCINFOW {
-    WCHAR[CCHCCCLASS] szClass;
+    WCHAR[CCHCCCLASS] szClass = 0;
     DWORD             flOptions;
-    WCHAR[CCHCCDESC]  szDesc;
+    WCHAR[CCHCCDESC]  szDesc = 0;
     UINT              cxDefault;
     UINT              cyDefault;
     DWORD             flStyleDefault;
     DWORD             flExtStyleDefault;
     DWORD             flCtrlTypeMask;
-    WCHAR[CCHCCTEXT]  szTextDefault;
+    WCHAR[CCHCCTEXT]  szTextDefault = 0;
     INT               cStyleFlags;
     LPCCSTYLEFLAGW    aStyleFlags;
     LPFNCCSTYLEW      lpfnStyle;
index fddfc633c3e67c602dac1a39a743fe2d26758234..44c195714375f634ac4e621a365cbafc5f59a50a 100644 (file)
@@ -12,7 +12,8 @@
 module core.sys.windows.dbghelp;
 version (Windows):
 
-import core.sys.windows.windows;
+import core.sys.windows.winbase /+: FreeLibrary, GetProcAddress, LoadLibraryA+/;
+import core.sys.windows.windef;
 
 public import core.sys.windows.dbghelp_types;
 
index ff52c565e1d343ea5e46e75fab53639dcbabce6f..f75f98bc88245ffd4c838e7d5d3b3209cdc2c1cc 100644 (file)
@@ -14,7 +14,8 @@ version (Windows):
 
 version (ANSI) {} else version = Unicode;
 
-import core.sys.windows.windows;
+import core.sys.windows.windef;
+import core.sys.windows.imagehlp /+: ADDRESS_MODE+/;
 
 public import core.sys.windows.winnt : TCHAR;
 
@@ -123,15 +124,15 @@ struct IMAGEHLP_MODULEA64
     DWORD      CheckSum;
     DWORD      NumSyms;
     SYM_TYPE   SymType;
-    CHAR[32]   ModuleName;
-    CHAR[256]  ImageName;
-    CHAR[256]  LoadedImageName;
+    CHAR[32]   ModuleName = 0;
+    CHAR[256]  ImageName = 0;
+    CHAR[256]  LoadedImageName = 0;
     // new elements: 07-Jun-2002
     version (none)
     {
-        CHAR[256]  LoadedPdbName;
+        CHAR[256]  LoadedPdbName = 0;
         DWORD      CVSig;
-        CHAR[MAX_PATH*3] CVData;
+        CHAR[MAX_PATH*3] CVData = 0;
         DWORD      PdbSig;
         GUID       PdbSig70;
         DWORD      PdbAge;
@@ -157,15 +158,15 @@ struct IMAGEHLP_MODULEW64
     DWORD      CheckSum;
     DWORD      NumSyms;
     SYM_TYPE   SymType;
-    WCHAR[32]  ModuleName;
-    WCHAR[256] ImageName;
-    WCHAR[256] LoadedImageName;
+    WCHAR[32]  ModuleName = 0;
+    WCHAR[256] ImageName = 0;
+    WCHAR[256] LoadedImageName = 0;
     // new elements: 07-Jun-2002
     version (none)
     {
-        WCHAR[256] LoadedPdbName;
+        WCHAR[256] LoadedPdbName = 0;
         DWORD      CVSig;
-        WCHAR[MAX_PATH*3] CVData;
+        WCHAR[MAX_PATH*3] CVData = 0;
         DWORD      PdbSig;
         GUID       PdbSig70;
         DWORD      PdbAge;
@@ -190,7 +191,7 @@ struct IMAGEHLP_SYMBOLA64
     DWORD    Size;
     DWORD    Flags;
     DWORD    MaxNameLength;
-    CHAR[1] Name;
+    CHAR[1] Name = 0;
 }
 struct IMAGEHLP_SYMBOLW64
 {
@@ -199,7 +200,7 @@ struct IMAGEHLP_SYMBOLW64
     DWORD    Size;
     DWORD    Flags;
     DWORD    MaxNameLength;
-    WCHAR[1] Name;
+    WCHAR[1] Name = 0;
 }
 
 
index c97944203ec5be649409b9b496136303b47bba22..c43f789a333a98414748551f6dfd416f95c8463c 100644 (file)
@@ -112,7 +112,7 @@ struct DEV_BROADCAST_PORT_A {
     DWORD dbcp_size = DEV_BROADCAST_PORT_A.sizeof;
     DWORD dbcp_devicetype;
     DWORD dbcp_reserved;
-    char  _dbcp_name;
+    char  _dbcp_name = 0;
     char* dbcp_name() return { return &_dbcp_name; }
 }
 alias DEV_BROADCAST_PORT_A* PDEV_BROADCAST_PORT_A;
@@ -121,14 +121,14 @@ struct DEV_BROADCAST_PORT_W {
     DWORD  dbcp_size = DEV_BROADCAST_PORT_W.sizeof;
     DWORD  dbcp_devicetype;
     DWORD  dbcp_reserved;
-    WCHAR  _dbcp_name;
+    WCHAR  _dbcp_name = 0;
     WCHAR* dbcp_name() return { return &_dbcp_name; }
 }
 alias DEV_BROADCAST_PORT_W* PDEV_BROADCAST_PORT_W;
 
 struct DEV_BROADCAST_USERDEFINED {
     DEV_BROADCAST_HDR dbud_dbh;
-    char  _dbud_szName;
+    char  _dbud_szName = 0;
     char* dbud_szName() return { return &_dbud_szName; }
 }
 
@@ -164,7 +164,7 @@ alias DEV_BROADCAST_PORT* PDEV_BROADCAST_PORT;
         DWORD  dbcc_devicetype;
         DWORD  dbcc_reserved;
         GUID   dbcc_classguid;
-        WCHAR  _dbcc_name;
+        WCHAR  _dbcc_name = 0;
         WCHAR* dbcc_name() return { return &_dbcc_name; }
     }
     alias DEV_BROADCAST_DEVICEINTERFACE_W* PDEV_BROADCAST_DEVICEINTERFACE_W;
index 4f84a0639eb399ec9c6af21d5cd2997419e10bed..a0cce304d9560b6ded0228faebac175c7736acf8 100644 (file)
@@ -249,7 +249,7 @@ struct MONHSZSTRUCT {
     DWORD    dwTime;
     HSZ      hsz;
     HANDLE   hTask;
-    TCHAR[1] _str;
+    TCHAR[1] _str = 0;
 
     TCHAR* str() return { return _str.ptr; }
 }
index f5ff243594d07599005e6f8e5a061b98c01534ac..3d6a15c834cfc6403797a4328c4ba25cc975b554 100644 (file)
@@ -15,7 +15,8 @@
 module core.sys.windows.dll;
 version (Windows):
 
-import core.sys.windows.windows;
+import core.sys.windows.winbase;
+import core.sys.windows.winnt;
 import core.stdc.string;
 import core.runtime;
 
@@ -486,12 +487,12 @@ bool dll_thread_detach( bool detach_thread = true, bool exitTls = true )
 /// ---
 mixin template SimpleDllMain()
 {
-    import core.sys.windows.windows : HINSTANCE;
+    import core.sys.windows.windef : HINSTANCE;
 
     extern(Windows)
     bool DllMain(HINSTANCE hInstance, uint ulReason, void* reserved)
     {
-        import core.sys.windows.windows;
+        import core.sys.windows.winnt;
         import core.sys.windows.dll :
             dll_process_attach, dll_process_detach,
             dll_thread_attach, dll_thread_detach;
index 1ea66db067213ec72a0fdcb9ac90d169e01f3622..0be79d755584f61dcde6927ff639ecaf91a926a7 100644 (file)
@@ -73,7 +73,7 @@ struct OLECMDTEXT {
     DWORD cmdtextf;
     ULONG cwActual;
     ULONG cwBuf;
-    wchar[1] rgwz;
+    wchar[1] rgwz = 0;
 }
 
 struct OLECMD {
index 0a3d79c88cf405dea74bafebe93d1cbdd74f9be0..546523407f29cbeefefcc9d6268eeb30d8dbb214 100644 (file)
@@ -19,7 +19,9 @@ version (Windows):
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */
 
-private import core.sys.windows.windows;
+private import core.sys.windows.basetsd /+: DECLARE_HANDLE, HANDLE+/;
+private import core.sys.windows.windef /+: BOOL, CHAR, DWORD, LPBYTE, LPDWORD+/;
+private import core.sys.windows.winnt /+: LPCSTR, LPSTR, LPVOID, PVOID, VOID+/;
 
 enum {
     HSE_VERSION_MAJOR               = 2,
@@ -49,7 +51,7 @@ mixin DECLARE_HANDLE!("HCONN");
 
 struct HSE_VERSION_INFO {
     DWORD dwExtensionVersion;
-    CHAR[HSE_MAX_EXT_DLL_NAME_LEN] lpszExtensionDesc;
+    CHAR[HSE_MAX_EXT_DLL_NAME_LEN] lpszExtensionDesc = 0;
 }
 alias HSE_VERSION_INFO* LPHSE_VERSION_INFO;
 
@@ -58,7 +60,7 @@ struct EXTENSION_CONTROL_BLOCK {
     DWORD  dwVersion;
     HCONN  ConnID;
     DWORD  dwHttpStatusCode;
-    CHAR[HSE_LOG_BUFFER_LEN] lpszLogData;
+    CHAR[HSE_LOG_BUFFER_LEN] lpszLogData = 0;
     LPSTR  lpszMethod;
     LPSTR  lpszQueryString;
     LPSTR  lpszPathInfo;
@@ -67,16 +69,16 @@ struct EXTENSION_CONTROL_BLOCK {
     DWORD  cbAvailable;
     LPBYTE lpbData;
     LPSTR  lpszContentType;
-    extern(Pascal) BOOL function(HCONN, LPSTR, LPVOID, LPDWORD)
-      GetServerVariable;
-    extern(Pascal) BOOL function(HCONN, LPVOID, LPDWORD, DWORD) WriteClient;
-    extern(Pascal) BOOL function(HCONN, LPVOID, LPDWORD) ReadClient;
-    extern(Pascal) BOOL function(HCONN, DWORD, LPVOID, LPDWORD, LPDWORD)
-      ServerSupportFunction;
+    extern (Windows) {
+        BOOL function(HCONN, LPSTR, LPVOID, LPDWORD) GetServerVariable;
+        BOOL function(HCONN, LPVOID, LPDWORD, DWORD) WriteClient;
+        BOOL function(HCONN, LPVOID, LPDWORD) ReadClient;
+        BOOL function(HCONN, DWORD, LPVOID, LPDWORD, LPDWORD) ServerSupportFunction;
+    }
 }
 alias EXTENSION_CONTROL_BLOCK* LPEXTENSION_CONTROL_BLOCK;
 
-extern (Pascal) {
+extern (Windows) {
     alias BOOL function(HSE_VERSION_INFO*) PFN_GETEXTENSIONVERSION;
     alias DWORD function(EXTENSION_CONTROL_BLOCK*) PFN_HTTPEXTENSIONPROC;
     alias BOOL function(DWORD) PFN_TERMINATEEXTENSION;
@@ -107,7 +109,7 @@ struct HSE_SEND_HEADER_EX_INFO {
 }
 alias HSE_SEND_HEADER_EX_INFO* LPHSE_SEND_HEADER_EX_INF;
 
-extern (Pascal) {
+extern (Windows) {
     BOOL GetExtensionVersion(HSE_VERSION_INFO*);
     DWORD HttpExtensionProc(EXTENSION_CONTROL_BLOCK*);
     BOOL TerminateExtension(DWORD);
index 017ecc83980654f1298e0ea4669db545860c4530..b77ef76104736fbb3ef3d4b1235cb4064cf6f59f 100644 (file)
@@ -230,7 +230,7 @@ struct IMAGEHLP_SYMBOL {
     DWORD   Size;
     DWORD   Flags;
     DWORD   MaxNameLength;
-    CHAR[1] Name;
+    CHAR[1] Name = 0;
 }
 alias IMAGEHLP_SYMBOL* PIMAGEHLP_SYMBOL;
 
@@ -242,9 +242,9 @@ struct IMAGEHLP_MODULE {
     DWORD     CheckSum;
     DWORD     NumSyms;
     SYM_TYPE  SymType;
-    CHAR[32]  ModuleName;
-    CHAR[256] ImageName;
-    CHAR[256] LoadedImageName;
+    CHAR[32]  ModuleName = 0;
+    CHAR[256] ImageName = 0;
+    CHAR[256] LoadedImageName = 0;
 }
 alias IMAGEHLP_MODULE* PIMAGEHLP_MODULE;
 
@@ -262,7 +262,7 @@ struct IMAGEHLP_DEFERRED_SYMBOL_LOAD {
     DWORD          BaseOfImage;
     DWORD          CheckSum;
     DWORD          TimeDateStamp;
-    CHAR[MAX_PATH] FileName;
+    CHAR[MAX_PATH] FileName = 0;
     BOOLEAN        Reparse;
 }
 alias IMAGEHLP_DEFERRED_SYMBOL_LOAD* PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
index f6b82df4f791fd843e0a0ba1ae6088899a488a14..5a55d04b38abd6c8d42692263a1390ebf27c8499 100644 (file)
@@ -320,13 +320,13 @@ alias REGISTERWORDW* PREGISTERWORDW, LPREGISTERWORDW;
 
 struct STYLEBUFA{
     DWORD dwStyle;
-    CHAR[STYLE_DESCRIPTION_SIZE] szDescription;
+    CHAR[STYLE_DESCRIPTION_SIZE] szDescription = 0;
 }
 alias STYLEBUFA* PSTYLEBUFA, LPSTYLEBUFA;
 
 struct STYLEBUFW{
     DWORD dwStyle;
-    WCHAR[STYLE_DESCRIPTION_SIZE] szDescription;
+    WCHAR[STYLE_DESCRIPTION_SIZE] szDescription = 0;
 }
 alias STYLEBUFW* PSTYLEBUFW, LPSTYLEBUFW;
 
@@ -338,7 +338,7 @@ struct IMEMENUITEMINFOA{
     HBITMAP hbmpChecked;
     HBITMAP hbmpUnchecked;
     DWORD dwItemData;
-    CHAR[IMEMENUITEM_STRING_SIZE] szString;
+    CHAR[IMEMENUITEM_STRING_SIZE] szString = 0;
     HBITMAP hbmpItem;
 }
 alias IMEMENUITEMINFOA* PIMEMENUITEMINFOA, LPIMEMENUITEMINFOA;
@@ -351,7 +351,7 @@ struct IMEMENUITEMINFOW{
     HBITMAP hbmpChecked;
     HBITMAP hbmpUnchecked;
     DWORD dwItemData;
-    WCHAR[IMEMENUITEM_STRING_SIZE] szString;
+    WCHAR[IMEMENUITEM_STRING_SIZE] szString = 0;
     HBITMAP hbmpItem;
 }
 alias IMEMENUITEMINFOW* PIMEMENUITEMINFOW, LPIMEMENUITEMINFOW;
index 6f4853567c55ab41e8c8e3083bd043196eee8f27..c9fcbd33a9ca8c6d260e73766f97fda17c5ff48d 100644 (file)
@@ -87,7 +87,7 @@ alias ICMP_ECHO_REPLY* PICMP_ECHO_REPLY;
 
 struct IP_ADAPTER_INDEX_MAP {
     ULONG                   Index;
-    WCHAR[MAX_ADAPTER_NAME] Name;
+    WCHAR[MAX_ADAPTER_NAME] Name = 0;
 }
 alias IP_ADAPTER_INDEX_MAP* PIP_ADAPTER_INDEX_MAP;
 
index d4f622dba832fbb8bfd7e56266ca908c8a1ea87f..4365723a50e7c72617aa5f4aea9c71e02a0603f4 100644 (file)
@@ -145,7 +145,7 @@ struct MIB_ICMP {
 alias MIB_ICMP* PMIB_ICMP;
 
 struct MIB_IFROW {
-    WCHAR[MAX_INTERFACE_NAME_LEN] wszName;
+    WCHAR[MAX_INTERFACE_NAME_LEN] wszName = 0;
     DWORD dwIndex;
     DWORD dwType;
     DWORD dwMtu;
index 296735d20300fa73c561d524d659e0dd85a91081..ada3e9cca583b110a97687a10c09245f54a8a9e0 100644 (file)
@@ -39,7 +39,7 @@ enum : UINT {
 }
 
 struct IP_ADDRESS_STRING {
-    char[16] String;
+    char[16] String = 0;
 }
 alias IP_ADDRESS_STRING IP_MASK_STRING;
 alias IP_ADDRESS_STRING* PIP_ADDRESS_STRING, PIP_MASK_STRING;
@@ -55,10 +55,10 @@ alias IP_ADDR_STRING* PIP_ADDR_STRING;
 struct IP_ADAPTER_INFO {
     IP_ADAPTER_INFO* Next;
     DWORD ComboIndex;
-    char[MAX_ADAPTER_NAME_LENGTH+4]        AdapterName;
-    char[MAX_ADAPTER_DESCRIPTION_LENGTH+4] Description;
+    char[MAX_ADAPTER_NAME_LENGTH+4]        AdapterName = 0;
+    char[MAX_ADAPTER_DESCRIPTION_LENGTH+4] Description = 0;
     UINT             AddressLength;
-    BYTE[MAX_ADAPTER_ADDRESS_LENGTH]       Address;
+    BYTE[MAX_ADAPTER_ADDRESS_LENGTH]       Address = 0;
     DWORD            Index;
     UINT             Type;
     UINT             DhcpEnabled;
@@ -83,12 +83,12 @@ struct IP_PER_ADAPTER_INFO {
 alias IP_PER_ADAPTER_INFO* PIP_PER_ADAPTER_INFO;
 
 struct FIXED_INFO {
-    char[MAX_HOSTNAME_LEN+4]    HostName;
-    char[MAX_DOMAIN_NAME_LEN+4] DomainName;
+    char[MAX_HOSTNAME_LEN+4]    HostName = 0;
+    char[MAX_DOMAIN_NAME_LEN+4] DomainName = 0;
     PIP_ADDR_STRING             CurrentDnsServer;
     IP_ADDR_STRING              DnsServerList;
     UINT                        NodeType;
-    char[MAX_SCOPE_ID_LEN+4]    ScopeId;
+    char[MAX_SCOPE_ID_LEN+4]    ScopeId = 0;
     UINT                        EnableRouting;
     UINT                        EnableProxy;
     UINT                        EnableDns;
index babc16ad9a5c3dd4d79f1a1f4c7cc32951b541f3..53acff035b5a173e8ab5626f1d86e0a507cac6ad 100644 (file)
@@ -46,8 +46,8 @@ alias ADMIN_OTHER_INFO* PADMIN_OTHER_INFO, LPADMIN_OTHER_INFO;
 
 struct STD_ALERT{
     DWORD alrt_timestamp;
-    TCHAR[EVLEN+1] alrt_eventname;
-    TCHAR[SNLEN+1] alrt_servicename;
+    TCHAR[EVLEN+1] alrt_eventname = 0;
+    TCHAR[SNLEN+1] alrt_servicename = 0;
 }
 alias STD_ALERT* PSTD_ALERT, LPSTD_ALERT;
 
index ab85952a4b0732c9d0bce9448a6a546e4be66601..2f8f03b8ab0ab688e892828b5bcf121d148bbfb1 100644 (file)
@@ -124,7 +124,7 @@ struct MapiMessage {
 }
 alias MapiMessage* lpMapiMessage;
 
-extern (Pascal) {
+extern (Windows) {
     ULONG MAPILogon(ULONG_PTR, LPSTR, LPSTR, FLAGS, ULONG, LPLHANDLE);
     ULONG MAPISendMail(LHANDLE, ULONG_PTR, lpMapiMessage, FLAGS, ULONG);
     ULONG MAPISendDocuments(ULONG_PTR, LPSTR, LPSTR, LPSTR, ULONG);
index d519e114de4fa5167fcc1540ce455c4e702a8dbe..ceb4c3d513a3f4ac7dbcac28c14dee00c793f594 100644 (file)
@@ -1106,7 +1106,7 @@ struct WAVEOUTCAPSA {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    CHAR[MAXPNAMELEN] szPname;
+    CHAR[MAXPNAMELEN] szPname = 0;
     DWORD dwFormats;
     WORD wChannels;
     WORD wReserved1;
@@ -1118,7 +1118,7 @@ struct WAVEOUTCAPSW {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    WCHAR[MAXPNAMELEN] szPname;
+    WCHAR[MAXPNAMELEN] szPname = 0;
     DWORD dwFormats;
     WORD wChannels;
     WORD wReserved1;
@@ -1130,7 +1130,7 @@ struct WAVEINCAPSA {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    CHAR[MAXPNAMELEN] szPname;
+    CHAR[MAXPNAMELEN] szPname = 0;
     DWORD dwFormats;
     WORD wChannels;
     WORD wReserved1;
@@ -1141,7 +1141,7 @@ struct WAVEINCAPSW {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    WCHAR[MAXPNAMELEN] szPname;
+    WCHAR[MAXPNAMELEN] szPname = 0;
     DWORD dwFormats;
     WORD wChannels;
     WORD wReserved1;
@@ -1194,7 +1194,7 @@ struct MIDIOUTCAPSA {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    CHAR[MAXPNAMELEN] szPname;
+    CHAR[MAXPNAMELEN] szPname = 0;
     WORD wTechnology;
     WORD wVoices;
     WORD wNotes;
@@ -1207,7 +1207,7 @@ struct MIDIOUTCAPSW {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    WCHAR[MAXPNAMELEN] szPname;
+    WCHAR[MAXPNAMELEN] szPname = 0;
     WORD wTechnology;
     WORD wVoices;
     WORD wNotes;
@@ -1220,7 +1220,7 @@ struct MIDIINCAPSA {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    CHAR[MAXPNAMELEN] szPname;
+    CHAR[MAXPNAMELEN] szPname = 0;
     DWORD dwSupport;
 }
 alias MIDIINCAPSA* PMIDIINCAPSA, LPMIDIINCAPSA;
@@ -1229,7 +1229,7 @@ struct MIDIINCAPSW {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    WCHAR[MAXPNAMELEN] szPname;
+    WCHAR[MAXPNAMELEN] szPname = 0;
     DWORD dwSupport;
 }
 alias MIDIINCAPSW* PMIDIINCAPSW, LPMIDIINCAPSW;
@@ -1277,7 +1277,7 @@ struct AUXCAPSA {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    CHAR[MAXPNAMELEN] szPname;
+    CHAR[MAXPNAMELEN] szPname = 0;
     WORD wTechnology;
     WORD wReserved1;
     DWORD dwSupport;
@@ -1288,7 +1288,7 @@ struct AUXCAPSW {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    WCHAR[MAXPNAMELEN] szPname;
+    WCHAR[MAXPNAMELEN] szPname = 0;
     WORD wTechnology;
     WORD wReserved1;
     DWORD dwSupport;
@@ -1305,7 +1305,7 @@ struct MIXERCAPSA {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    CHAR[MAXPNAMELEN] szPname;
+    CHAR[MAXPNAMELEN] szPname = 0;
     DWORD fdwSupport;
     DWORD cDestinations;
 }
@@ -1315,7 +1315,7 @@ struct MIXERCAPSW {
     WORD wMid;
     WORD wPid;
     MMVERSION vDriverVersion;
-    WCHAR[MAXPNAMELEN] szPname;
+    WCHAR[MAXPNAMELEN] szPname = 0;
     DWORD fdwSupport;
     DWORD cDestinations;
 }
@@ -1333,15 +1333,15 @@ align(1):
     DWORD cChannels;
     DWORD cConnections;
     DWORD cControls;
-    CHAR[MIXER_SHORT_NAME_CHARS] szShortName;
-    CHAR[MIXER_LONG_NAME_CHARS] szName;
+    CHAR[MIXER_SHORT_NAME_CHARS] szShortName = 0;
+    CHAR[MIXER_LONG_NAME_CHARS] szName = 0;
     struct _Target {
         DWORD dwType;
         DWORD dwDeviceID;
         WORD wMid;
         WORD wPid;
         MMVERSION vDriverVersion;
-        CHAR[MAXPNAMELEN] szPname;
+        CHAR[MAXPNAMELEN] szPname = 0;
     }
     _Target Target;
 }
@@ -1359,15 +1359,15 @@ align(1):
     DWORD cChannels;
     DWORD cConnections;
     DWORD cControls;
-    WCHAR[MIXER_SHORT_NAME_CHARS] szShortName;
-    WCHAR[MIXER_LONG_NAME_CHARS] szName;
+    WCHAR[MIXER_SHORT_NAME_CHARS] szShortName = 0;
+    WCHAR[MIXER_LONG_NAME_CHARS] szName = 0;
     struct _Target {
         DWORD dwType;
         DWORD dwDeviceID;
         WORD wMid;
         WORD wPid;
         MMVERSION vDriverVersion;
-        WCHAR[MAXPNAMELEN] szPname;
+        WCHAR[MAXPNAMELEN] szPname = 0;
     }
     _Target Target;
 }
@@ -1379,8 +1379,8 @@ struct MIXERCONTROLA {
     DWORD dwControlType;
     DWORD fdwControl;
     DWORD cMultipleItems;
-    CHAR[MIXER_SHORT_NAME_CHARS] szShortName;
-    CHAR[MIXER_LONG_NAME_CHARS] szName;
+    CHAR[MIXER_SHORT_NAME_CHARS] szShortName = 0;
+    CHAR[MIXER_LONG_NAME_CHARS] szName = 0;
     union _Bounds {
         struct {
             LONG lMinimum;
@@ -1408,8 +1408,8 @@ struct MIXERCONTROLW {
     DWORD dwControlType;
     DWORD fdwControl;
     DWORD cMultipleItems;
-    WCHAR[MIXER_SHORT_NAME_CHARS] szShortName;
-    WCHAR[MIXER_LONG_NAME_CHARS] szName;
+    WCHAR[MIXER_SHORT_NAME_CHARS] szShortName = 0;
+    WCHAR[MIXER_LONG_NAME_CHARS] szName = 0;
     union _Bounds {
         struct {
             LONG lMinimum;
@@ -1477,14 +1477,14 @@ alias MIXERCONTROLDETAILS* PMIXERCONTROLDETAILS, LPMIXERCONTROLDETAILS;
 struct MIXERCONTROLDETAILS_LISTTEXTA {
     DWORD dwParam1;
     DWORD dwParam2;
-    CHAR[MIXER_LONG_NAME_CHARS] szName;
+    CHAR[MIXER_LONG_NAME_CHARS] szName = 0;
 }
 alias MIXERCONTROLDETAILS_LISTTEXTA* PMIXERCONTROLDETAILS_LISTTEXTA, LPMIXERCONTROLDETAILS_LISTTEXTA;
 
 struct MIXERCONTROLDETAILS_LISTTEXTW {
     DWORD dwParam1;
     DWORD dwParam2;
-    WCHAR[MIXER_LONG_NAME_CHARS] szName;
+    WCHAR[MIXER_LONG_NAME_CHARS] szName = 0;
 }
 alias MIXERCONTROLDETAILS_LISTTEXTW* PMIXERCONTROLDETAILS_LISTTEXTW, LPMIXERCONTROLDETAILS_LISTTEXTW;
 
@@ -1514,7 +1514,7 @@ alias TIMECAPS* PTIMECAPS, LPTIMECAPS;
 struct JOYCAPSA {
     WORD wMid;
     WORD wPid;
-    CHAR[MAXPNAMELEN] szPname;
+    CHAR[MAXPNAMELEN] szPname = 0;
     UINT wXmin;
     UINT wXmax;
     UINT wYmin;
@@ -1534,15 +1534,15 @@ struct JOYCAPSA {
     UINT wMaxAxes;
     UINT wNumAxes;
     UINT wMaxButtons;
-    CHAR[MAXPNAMELEN] szRegKey;
-    CHAR[MAX_JOYSTICKOEMVXDNAME] szOEMVxD;
+    CHAR[MAXPNAMELEN] szRegKey = 0;
+    CHAR[MAX_JOYSTICKOEMVXDNAME] szOEMVxD = 0;
 }
 alias JOYCAPSA* PJOYCAPSA, LPJOYCAPSA;
 
 struct JOYCAPSW {
     WORD wMid;
     WORD wPid;
-    WCHAR[MAXPNAMELEN] szPname;
+    WCHAR[MAXPNAMELEN] szPname = 0;
     UINT wXmin;
     UINT wXmax;
     UINT wYmin;
@@ -1562,8 +1562,8 @@ struct JOYCAPSW {
     UINT wMaxAxes;
     UINT wNumAxes;
     UINT wMaxButtons;
-    WCHAR[MAXPNAMELEN] szRegKey;
-    WCHAR[MAX_JOYSTICKOEMVXDNAME] szOEMVxD;
+    WCHAR[MAXPNAMELEN] szRegKey = 0;
+    WCHAR[MAX_JOYSTICKOEMVXDNAME] szOEMVxD = 0;
 }
 alias JOYCAPSW* PJOYCAPSW, LPJOYCAPSW;
 
index 04f6157df82bc17c9a9d207af14ec1fb066ff707..c6bf8af248eefb0ce1de8fa929ddc2968a3c2040 100644 (file)
@@ -38,7 +38,7 @@ struct ACMFORMATDETAILSA {
     DWORD          fdwSupport;
     LPWAVEFORMATEX pwfx;
     DWORD          cbwfx;
-    char[ACMFORMATDETAILS_FORMAT_CHARS] szFormat;
+    char[ACMFORMATDETAILS_FORMAT_CHARS] szFormat = 0;
 }
 alias ACMFORMATDETAILSA* LPACMFORMATDETAILSA;
 
@@ -49,7 +49,7 @@ struct ACMFORMATDETAILSW {
     DWORD          fdwSupport;
     LPWAVEFORMATEX pwfx;
     DWORD          cbwfx;
-    WCHAR[ACMFORMATDETAILS_FORMAT_CHARS] szFormat;
+    WCHAR[ACMFORMATDETAILS_FORMAT_CHARS] szFormat = 0;
 }
 alias ACMFORMATDETAILSW* LPACMFORMATDETAILSW;
 
@@ -60,7 +60,7 @@ struct ACMFORMATTAGDETAILSA {
     DWORD cbFormatSize;
     DWORD fdwSupport;
     DWORD cStandardFormats;
-    char[ACMFORMATTAGDETAILS_FORMATTAG_CHARS] szFormatTag;
+    char[ACMFORMATTAGDETAILS_FORMATTAG_CHARS] szFormatTag = 0;
 }
 alias ACMFORMATTAGDETAILSA* LPACMFORMATTAGDETAILSA;
 
@@ -71,7 +71,7 @@ struct ACMFORMATTAGDETAILSW {
     DWORD cbFormatSize;
     DWORD fdwSupport;
     DWORD cStandardFormats;
-    WCHAR[ACMFORMATTAGDETAILS_FORMATTAG_CHARS] szFormatTag;
+    WCHAR[ACMFORMATTAGDETAILS_FORMATTAG_CHARS] szFormatTag = 0;
 }
 alias ACMFORMATTAGDETAILSW* LPACMFORMATTAGDETAILSW;
 
@@ -88,11 +88,11 @@ align(1):
     DWORD  cFormatTags;
     DWORD  cFilterTags;
     HICON  hicon;
-    char[ACMDRIVERDETAILS_SHORTNAME_CHARS] szShortName;
-    char[ACMDRIVERDETAILS_LONGNAME_CHARS]  szLongName;
-    char[ACMDRIVERDETAILS_COPYRIGHT_CHARS] szCopyright;
-    char[ACMDRIVERDETAILS_LICENSING_CHARS] szLicensing;
-    char[ACMDRIVERDETAILS_FEATURES_CHARS]  szFeatures;
+    char[ACMDRIVERDETAILS_SHORTNAME_CHARS] szShortName = 0;
+    char[ACMDRIVERDETAILS_LONGNAME_CHARS]  szLongName = 0;
+    char[ACMDRIVERDETAILS_COPYRIGHT_CHARS] szCopyright = 0;
+    char[ACMDRIVERDETAILS_LICENSING_CHARS] szLicensing = 0;
+    char[ACMDRIVERDETAILS_FEATURES_CHARS]  szFeatures = 0;
 }
 alias ACMDRIVERDETAILSA* LPACMDRIVERDETAILSA;
 
@@ -109,11 +109,11 @@ align(1):
     DWORD  cFormatTags;
     DWORD  cFilterTags;
     HICON  hicon;
-    WCHAR[ACMDRIVERDETAILS_SHORTNAME_CHARS] szShortName;
-    WCHAR[ACMDRIVERDETAILS_LONGNAME_CHARS]  szLongName;
-    WCHAR[ACMDRIVERDETAILS_COPYRIGHT_CHARS] szCopyright;
-    WCHAR[ACMDRIVERDETAILS_LICENSING_CHARS] szLicensing;
-    WCHAR[ACMDRIVERDETAILS_FEATURES_CHARS]  szFeatures;
+    WCHAR[ACMDRIVERDETAILS_SHORTNAME_CHARS] szShortName = 0;
+    WCHAR[ACMDRIVERDETAILS_LONGNAME_CHARS]  szLongName = 0;
+    WCHAR[ACMDRIVERDETAILS_COPYRIGHT_CHARS] szCopyright = 0;
+    WCHAR[ACMDRIVERDETAILS_LICENSING_CHARS] szLicensing = 0;
+    WCHAR[ACMDRIVERDETAILS_FEATURES_CHARS]  szFeatures = 0;
 }
 alias ACMDRIVERDETAILSW* LPACMDRIVERDETAILSW;
 
index d96b6e4996e384200ffd1c3136a064579045c590..7b3367705b15087ce9d88ddb04af2a7fe4049f64 100644 (file)
@@ -249,7 +249,7 @@ enum MKREDUCE {
 struct RemSNB {
     uint ulCntStr;
     uint ulCntChar;
-    OLECHAR[1] rgString;
+    OLECHAR[1] rgString = 0;
 }
 
 enum ADVF {
@@ -391,7 +391,7 @@ struct PROPVARIANT {
     WORD wReserved2;
     WORD wReserved3;
     union {
-        CHAR cVal;
+        CHAR cVal = 0;
         UCHAR bVal;
         short iVal;
         USHORT uiVal;
index 71b5dcd7c096a565efbaade28be221a613071302..732d302ac0271f2846be9611ae967e4f9cc5a2d4 100644 (file)
@@ -11,8 +11,7 @@ version (Windows):
 
 version (ANSI) {} else version = Unicode;
 
-import core.sys.windows.commdlg, core.sys.windows.dlgs, core.sys.windows.ole2, core.sys.windows.prsht, core.sys.windows.shellapi,
-  core.sys.windows.windows;
+import core.sys.windows.commdlg, core.sys.windows.dlgs, core.sys.windows.ole2, core.sys.windows.prsht, core.sys.windows.shellapi;
 private import core.sys.windows.winbase, core.sys.windows.objidl, core.sys.windows.objfwd, core.sys.windows.winnt;
 
 // FIXME: remove inherited methods from interface definitions
@@ -546,7 +545,7 @@ struct OLEUICHANGEICONW {
     HRSRC hResource;
     HGLOBAL hMetaPict;
     CLSID clsid;
-    WCHAR[MAX_PATH] szIconExe;
+    WCHAR[MAX_PATH] szIconExe = 0;
     int cchIconExe;
 }
 alias OLEUICHANGEICONW* POLEUICHANGEICONW, LPOLEUICHANGEICONW;
@@ -563,7 +562,7 @@ struct OLEUICHANGEICONA {
     HRSRC hResource;
     HGLOBAL hMetaPict;
     CLSID clsid;
-    CHAR[MAX_PATH] szIconExe;
+    CHAR[MAX_PATH] szIconExe = 0;
     int cchIconExe;
 }
 alias OLEUICHANGEICONA* POLEUICHANGEICONA, LPOLEUICHANGEICONA;
index f480c2bc91e2d0b5c10c484da1b8c1cba5291c7c..479aa3ba0bf234738f4be97d88d78b598386d6bd 100644 (file)
@@ -231,12 +231,12 @@ align(4):
     DWORD dwSize;
     HRASCONN hrasconn;
     align {
-    WCHAR[RAS_MaxEntryName + 1] szEntryName;
-    WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
-    WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
+    WCHAR[RAS_MaxEntryName + 1] szEntryName = 0;
+    WCHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+    WCHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
     }
     //static if (_WIN32_WINNT >= 0x401) {
-        WCHAR[MAX_PATH] szPhonebook;
+        WCHAR[MAX_PATH] szPhonebook = 0;
         DWORD dwSubEntry;
     //}
     //static if (_WIN32_WINNT >= 0x500) {
@@ -254,12 +254,12 @@ align(4):
     DWORD dwSize;
     HRASCONN hrasconn;
     align {
-    CHAR[RAS_MaxEntryName + 1] szEntryName;
-    CHAR[RAS_MaxDeviceType + 1] szDeviceType;
-    CHAR[RAS_MaxDeviceName + 1] szDeviceName;
+    CHAR[RAS_MaxEntryName + 1] szEntryName = 0;
+    CHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+    CHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
     }
     //static if (_WIN32_WINNT >= 0x401) {
-        CHAR[MAX_PATH] szPhonebook;
+        CHAR[MAX_PATH] szPhonebook = 0;
         DWORD dwSubEntry;
     //}
     //static if (_WIN32_WINNT >= 0x500) {
@@ -276,10 +276,10 @@ struct RASCONNSTATUSW {
     DWORD dwSize;
     RASCONNSTATE rasconnstate;
     DWORD dwError;
-    WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
-    WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
+    WCHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+    WCHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
     static if (_WIN32_WINNT >= 0x401) {
-        WCHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber;
+        WCHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber = 0;
     }
 }
 alias RASCONNSTATUSW* LPRASCONNSTATUSW;
@@ -288,10 +288,10 @@ struct RASCONNSTATUSA {
     DWORD dwSize;
     RASCONNSTATE rasconnstate;
     DWORD dwError;
-    CHAR[RAS_MaxDeviceType + 1] szDeviceType;
-    CHAR[RAS_MaxDeviceName + 1] szDeviceName;
+    CHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+    CHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
     static if (_WIN32_WINNT >= 0x401) {
-        CHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber;
+        CHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber = 0;
     }
 }
 alias RASCONNSTATUSA* LPRASCONNSTATUSA;
@@ -300,12 +300,12 @@ struct RASDIALPARAMSW {
 align(4):
     DWORD dwSize;
 align {
-    WCHAR[RAS_MaxEntryName + 1] szEntryName;
-    WCHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber;
-    WCHAR[RAS_MaxCallbackNumber + 1] szCallbackNumber;
-    WCHAR[UNLEN + 1] szUserName;
-    WCHAR[PWLEN + 1] szPassword;
-    WCHAR[DNLEN + 1] szDomain;
+    WCHAR[RAS_MaxEntryName + 1] szEntryName = 0;
+    WCHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber = 0;
+    WCHAR[RAS_MaxCallbackNumber + 1] szCallbackNumber = 0;
+    WCHAR[UNLEN + 1] szUserName = 0;
+    WCHAR[PWLEN + 1] szPassword = 0;
+    WCHAR[DNLEN + 1] szDomain = 0;
 }
     static if (_WIN32_WINNT >= 0x401) {
         DWORD dwSubEntry;
@@ -318,12 +318,12 @@ struct RASDIALPARAMSA{
 align(4):
     DWORD dwSize;
 align {
-    CHAR[RAS_MaxEntryName + 1] szEntryName;
-    CHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber;
-    CHAR[RAS_MaxCallbackNumber + 1] szCallbackNumber;
-    CHAR[UNLEN + 1] szUserName;
-    CHAR[PWLEN + 1] szPassword;
-    CHAR[DNLEN + 1] szDomain;
+    CHAR[RAS_MaxEntryName + 1] szEntryName = 0;
+    CHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber = 0;
+    CHAR[RAS_MaxCallbackNumber + 1] szCallbackNumber = 0;
+    CHAR[UNLEN + 1] szUserName = 0;
+    CHAR[PWLEN + 1] szPassword = 0;
+    CHAR[DNLEN + 1] szDomain = 0;
 }
     static if (_WIN32_WINNT >= 0x401) {
         DWORD dwSubEntry;
@@ -355,20 +355,20 @@ alias RASDIALEXTENSIONS* LPRASDIALEXTENSIONS;
 
 struct RASENTRYNAMEW {
     DWORD dwSize;
-    WCHAR[RAS_MaxEntryName + 1] szEntryName;
+    WCHAR[RAS_MaxEntryName + 1] szEntryName = 0;
     //static if (_WIN32_WINNT >= 0x500) {
         DWORD dwFlags;
-        WCHAR[MAX_PATH + 1] szPhonebookPath;
+        WCHAR[MAX_PATH + 1] szPhonebookPath = 0;
     //}
 }
 alias RASENTRYNAMEW* LPRASENTRYNAMEW;
 
 struct RASENTRYNAMEA{
     DWORD dwSize;
-    CHAR[RAS_MaxEntryName + 1] szEntryName;
+    CHAR[RAS_MaxEntryName + 1] szEntryName = 0;
     //static if (_WIN32_WINNT >= 0x500) {
         DWORD dwFlags;
-        CHAR[MAX_PATH + 1] szPhonebookPath;
+        CHAR[MAX_PATH + 1] szPhonebookPath = 0;
     //}
 }
 alias RASENTRYNAMEA* LPRASENTRYNAMEA;
@@ -376,7 +376,7 @@ alias RASENTRYNAMEA* LPRASENTRYNAMEA;
 struct RASAMBW{
     DWORD dwSize;
     DWORD dwError;
-    WCHAR[NETBIOS_NAME_LEN + 1] szNetBiosError;
+    WCHAR[NETBIOS_NAME_LEN + 1] szNetBiosError = 0;
     BYTE bLana;
 }
 alias RASAMBW* LPRASAMBW;
@@ -384,7 +384,7 @@ alias RASAMBW* LPRASAMBW;
 struct RASAMBA{
     DWORD dwSize;
     DWORD dwError;
-    CHAR[NETBIOS_NAME_LEN + 1] szNetBiosError;
+    CHAR[NETBIOS_NAME_LEN + 1] szNetBiosError = 0;
     BYTE bLana;
 }
 alias RASAMBA* LPRASAMBA;
@@ -393,8 +393,8 @@ struct RASPPPNBFW{
     DWORD dwSize;
     DWORD dwError;
     DWORD dwNetBiosError;
-    WCHAR[NETBIOS_NAME_LEN + 1] szNetBiosError;
-    WCHAR[NETBIOS_NAME_LEN + 1] szWorkstationName;
+    WCHAR[NETBIOS_NAME_LEN + 1] szNetBiosError = 0;
+    WCHAR[NETBIOS_NAME_LEN + 1] szWorkstationName = 0;
     BYTE bLana;
 }
 alias RASPPPNBFW* LPRASPPPNBFW;
@@ -403,8 +403,8 @@ struct RASPPPNBFA{
     DWORD dwSize;
     DWORD dwError;
     DWORD dwNetBiosError;
-    CHAR[NETBIOS_NAME_LEN + 1] szNetBiosError;
-    CHAR[NETBIOS_NAME_LEN + 1] szWorkstationName;
+    CHAR[NETBIOS_NAME_LEN + 1] szNetBiosError = 0;
+    CHAR[NETBIOS_NAME_LEN + 1] szWorkstationName = 0;
     BYTE bLana;
 }
 alias RASPPPNBFA* LPRASPPPNBFA;
@@ -412,23 +412,23 @@ alias RASPPPNBFA* LPRASPPPNBFA;
 struct RASPPPIPXW {
     DWORD dwSize;
     DWORD dwError;
-    WCHAR[RAS_MaxIpxAddress + 1] szIpxAddress;
+    WCHAR[RAS_MaxIpxAddress + 1] szIpxAddress = 0;
 }
 alias RASPPPIPXW* LPRASPPPIPXW;
 
 struct RASPPPIPXA {
     DWORD dwSize;
     DWORD dwError;
-    CHAR[RAS_MaxIpxAddress + 1] szIpxAddress;
+    CHAR[RAS_MaxIpxAddress + 1] szIpxAddress = 0;
 }
 alias RASPPPIPXA* LPRASPPPIPXA;
 
 struct RASPPPIPW{
     DWORD dwSize;
     DWORD dwError;
-    WCHAR[RAS_MaxIpAddress + 1] szIpAddress;
+    WCHAR[RAS_MaxIpAddress + 1] szIpAddress = 0;
     //#ifndef WINNT35COMPATIBLE
-    WCHAR[RAS_MaxIpAddress + 1] szServerIpAddress;
+    WCHAR[RAS_MaxIpAddress + 1] szServerIpAddress = 0;
     //#endif
     //static if (_WIN32_WINNT >= 0x500) {
         DWORD dwOptions;
@@ -440,9 +440,9 @@ alias RASPPPIPW* LPRASPPPIPW;
 struct RASPPPIPA{
     DWORD dwSize;
     DWORD dwError;
-    CHAR[RAS_MaxIpAddress + 1] szIpAddress;
+    CHAR[RAS_MaxIpAddress + 1] szIpAddress = 0;
     //#ifndef WINNT35COMPATIBLE
-    CHAR[RAS_MaxIpAddress + 1] szServerIpAddress;
+    CHAR[RAS_MaxIpAddress + 1] szServerIpAddress = 0;
     //#endif
     //static if (_WIN32_WINNT >= 0x500) {
         DWORD dwOptions;
@@ -465,7 +465,7 @@ struct RASPPPLCPW{
         BOOL fMultilink;
         DWORD dwTerminateReason;
         DWORD dwServerTerminateReason;
-        WCHAR[RAS_MaxReplyMessage] szReplyMessage;
+        WCHAR[RAS_MaxReplyMessage] szReplyMessage = 0;
         DWORD dwOptions;
         DWORD dwServerOptions;
     //}
@@ -486,7 +486,7 @@ struct RASPPPLCPA{
         BOOL fMultilink;
         DWORD dwTerminateReason;
         DWORD dwServerTerminateReason;
-        CHAR[RAS_MaxReplyMessage] szReplyMessage;
+        CHAR[RAS_MaxReplyMessage] szReplyMessage = 0;
         DWORD dwOptions;
         DWORD dwServerOptions;
     //}
@@ -496,28 +496,28 @@ alias RASPPPLCPA* LPRASPPPLCPA;
 struct RASSLIPW{
     DWORD dwSize;
     DWORD dwError;
-    WCHAR[RAS_MaxIpAddress + 1] szIpAddress;
+    WCHAR[RAS_MaxIpAddress + 1] szIpAddress = 0;
 }
 alias RASSLIPW* LPRASSLIPW;
 
 struct RASSLIPA{
     DWORD dwSize;
     DWORD dwError;
-    CHAR[RAS_MaxIpAddress + 1] szIpAddress;
+    CHAR[RAS_MaxIpAddress + 1] szIpAddress = 0;
 }
 alias RASSLIPA* LPRASSLIPA;
 
 struct RASDEVINFOW{
     DWORD dwSize;
-    WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
-    WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
+    WCHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+    WCHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
 }
 alias RASDEVINFOW* LPRASDEVINFOW;
 
 struct RASDEVINFOA{
     DWORD dwSize;
-    CHAR[RAS_MaxDeviceType + 1] szDeviceType;
-    CHAR[RAS_MaxDeviceName + 1] szDeviceName;
+    CHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+    CHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
 }
 alias RASDEVINFOA* LPRASDEVINFOA;
 
@@ -545,8 +545,8 @@ struct RASENTRYW {
     DWORD dwfOptions;
     DWORD dwCountryID;
     DWORD dwCountryCode;
-    WCHAR[RAS_MaxAreaCode + 1] szAreaCode;
-    WCHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber;
+    WCHAR[RAS_MaxAreaCode + 1] szAreaCode = 0;
+    WCHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber = 0;
     DWORD dwAlternateOffset;
     RASIPADDR ipaddr;
     RASIPADDR ipaddrDns;
@@ -556,15 +556,15 @@ struct RASENTRYW {
     DWORD dwFrameSize;
     DWORD dwfNetProtocols;
     DWORD dwFramingProtocol;
-    WCHAR[MAX_PATH] szScript;
-    WCHAR[MAX_PATH] szAutodialDll;
-    WCHAR[MAX_PATH] szAutodialFunc;
-    WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
-    WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
-    WCHAR[RAS_MaxPadType + 1] szX25PadType;
-    WCHAR[RAS_MaxX25Address + 1] szX25Address;
-    WCHAR[RAS_MaxFacilities + 1] szX25Facilities;
-    WCHAR[RAS_MaxUserData + 1] szX25UserData;
+    WCHAR[MAX_PATH] szScript = 0;
+    WCHAR[MAX_PATH] szAutodialDll = 0;
+    WCHAR[MAX_PATH] szAutodialFunc = 0;
+    WCHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+    WCHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
+    WCHAR[RAS_MaxPadType + 1] szX25PadType = 0;
+    WCHAR[RAS_MaxX25Address + 1] szX25Address = 0;
+    WCHAR[RAS_MaxFacilities + 1] szX25Facilities = 0;
+    WCHAR[RAS_MaxUserData + 1] szX25UserData = 0;
     DWORD dwChannels;
     DWORD dwReserved1;
     DWORD dwReserved2;
@@ -582,7 +582,7 @@ struct RASENTRYW {
         DWORD dwEncryptionType;
         DWORD dwCustomAuthKey;
         GUID guidId;
-        WCHAR[MAX_PATH] szCustomDialDll;
+        WCHAR[MAX_PATH] szCustomDialDll = 0;
         DWORD dwVpnStrategy;
     //}
 }
@@ -593,8 +593,8 @@ struct RASENTRYA {
     DWORD dwfOptions;
     DWORD dwCountryID;
     DWORD dwCountryCode;
-    CHAR[RAS_MaxAreaCode + 1] szAreaCode;
-    CHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber;
+    CHAR[RAS_MaxAreaCode + 1] szAreaCode = 0;
+    CHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber = 0;
     DWORD dwAlternateOffset;
     RASIPADDR ipaddr;
     RASIPADDR ipaddrDns;
@@ -604,15 +604,15 @@ struct RASENTRYA {
     DWORD dwFrameSize;
     DWORD dwfNetProtocols;
     DWORD dwFramingProtocol;
-    CHAR[MAX_PATH] szScript;
-    CHAR[MAX_PATH] szAutodialDll;
-    CHAR[MAX_PATH] szAutodialFunc;
-    CHAR[RAS_MaxDeviceType + 1] szDeviceType;
-    CHAR[RAS_MaxDeviceName + 1] szDeviceName;
-    CHAR[RAS_MaxPadType + 1] szX25PadType;
-    CHAR[RAS_MaxX25Address + 1] szX25Address;
-    CHAR[RAS_MaxFacilities + 1] szX25Facilities;
-    CHAR[RAS_MaxUserData + 1] szX25UserData;
+    CHAR[MAX_PATH] szScript = 0;
+    CHAR[MAX_PATH] szAutodialDll = 0;
+    CHAR[MAX_PATH] szAutodialFunc = 0;
+    CHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+    CHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
+    CHAR[RAS_MaxPadType + 1] szX25PadType = 0;
+    CHAR[RAS_MaxX25Address + 1] szX25Address = 0;
+    CHAR[RAS_MaxFacilities + 1] szX25Facilities = 0;
+    CHAR[RAS_MaxUserData + 1] szX25UserData = 0;
     DWORD dwChannels;
     DWORD dwReserved1;
     DWORD dwReserved2;
@@ -630,7 +630,7 @@ struct RASENTRYA {
         DWORD dwEncryptionType;
         DWORD dwCustomAuthKey;
         GUID guidId;
-        CHAR[MAX_PATH] szCustomDialDll;
+        CHAR[MAX_PATH] szCustomDialDll = 0;
         DWORD dwVpnStrategy;
     //}
 }
@@ -651,9 +651,9 @@ alias RASENTRYA* LPRASENTRYA;
     struct RASSUBENTRYW{
         DWORD dwSize;
         DWORD dwfFlags;
-        WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
-        WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
-        WCHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber;
+        WCHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+        WCHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
+        WCHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber = 0;
         DWORD dwAlternateOffset;
     }
     alias RASSUBENTRYW* LPRASSUBENTRYW;
@@ -661,9 +661,9 @@ alias RASENTRYA* LPRASENTRYA;
     struct RASSUBENTRYA{
         DWORD dwSize;
         DWORD dwfFlags;
-        CHAR[RAS_MaxDeviceType + 1] szDeviceType;
-        CHAR[RAS_MaxDeviceName + 1] szDeviceName;
-        CHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber;
+        CHAR[RAS_MaxDeviceType + 1] szDeviceType = 0;
+        CHAR[RAS_MaxDeviceName + 1] szDeviceName = 0;
+        CHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber = 0;
         DWORD dwAlternateOffset;
     }
     alias RASSUBENTRYA* LPRASSUBENTRYA;
@@ -671,18 +671,18 @@ alias RASENTRYA* LPRASENTRYA;
     struct RASCREDENTIALSW{
         DWORD dwSize;
         DWORD dwMask;
-        WCHAR[UNLEN + 1] szUserName;
-        WCHAR[PWLEN + 1] szPassword;
-        WCHAR[DNLEN + 1] szDomain;
+        WCHAR[UNLEN + 1] szUserName = 0;
+        WCHAR[PWLEN + 1] szPassword = 0;
+        WCHAR[DNLEN + 1] szDomain = 0;
     }
     alias RASCREDENTIALSW* LPRASCREDENTIALSW;
 
     struct RASCREDENTIALSA{
         DWORD dwSize;
         DWORD dwMask;
-        CHAR[UNLEN + 1] szUserName;
-        CHAR[PWLEN + 1] szPassword;
-        CHAR[DNLEN + 1] szDomain;
+        CHAR[UNLEN + 1] szUserName = 0;
+        CHAR[PWLEN + 1] szPassword = 0;
+        CHAR[DNLEN + 1] szDomain = 0;
     }
     alias RASCREDENTIALSA* LPRASCREDENTIALSA;
 
@@ -690,7 +690,7 @@ alias RASENTRYA* LPRASENTRYA;
         DWORD dwSize;
         DWORD dwFlags;
         DWORD dwDialingLocation;
-        WCHAR[RAS_MaxEntryName + 1] szEntry;
+        WCHAR[RAS_MaxEntryName + 1] szEntry = 0;
     }
     alias RASAUTODIALENTRYW* LPRASAUTODIALENTRYW;
 
@@ -698,7 +698,7 @@ alias RASENTRYA* LPRASENTRYA;
         DWORD dwSize;
         DWORD dwFlags;
         DWORD dwDialingLocation;
-        CHAR[RAS_MaxEntryName + 1] szEntry;
+        CHAR[RAS_MaxEntryName + 1] szEntry = 0;
     }
     alias RASAUTODIALENTRYA* LPRASAUTODIALENTRYA;
 //}
@@ -715,14 +715,14 @@ alias RASENTRYA* LPRASENTRYA;
     alias RASPPPCCP* LPRASPPPCCP;
 
     struct RASEAPUSERIDENTITYW{
-        WCHAR[UNLEN + 1] szUserName;
+        WCHAR[UNLEN + 1] szUserName = 0;
         DWORD dwSizeofEapInfo;
         BYTE[1] pbEapInfo;
     }
     alias RASEAPUSERIDENTITYW* LPRASEAPUSERIDENTITYW;
 
     struct RASEAPUSERIDENTITYA{
-        CHAR[UNLEN + 1] szUserName;
+        CHAR[UNLEN + 1] szUserName = 0;
         DWORD dwSizeofEapInfo;
         BYTE[1] pbEapInfo;
     }
index 5295b62020489120024a88435378e1b0a8d8d079..77346cb3318dafed2dd33674aa282bf8b1dd1225 100644 (file)
@@ -44,7 +44,7 @@ align(4):
     DWORD     dwFlags;
     LONG      xDlg;
     LONG      yDlg;
-    CHAR[RAS_MaxEntryName + 1] szEntry;
+    CHAR[RAS_MaxEntryName + 1] szEntry = 0;
     DWORD     dwError;
     ULONG_PTR reserved;
     ULONG_PTR reserved2;
@@ -58,7 +58,7 @@ align(4):
     DWORD     dwFlags;
     LONG      xDlg;
     LONG      yDlg;
-    WCHAR[RAS_MaxEntryName + 1] szEntry;
+    WCHAR[RAS_MaxEntryName + 1] szEntry = 0;
     DWORD     dwError;
     ULONG_PTR reserved;
     ULONG_PTR reserved2;
@@ -120,9 +120,9 @@ struct RASNOUSERA
     DWORD           dwSize = RASNOUSERA.sizeof;
     DWORD           dwFlags;
     DWORD           dwTimeoutMs;
-    CHAR[UNLEN + 1] szUserName;
-    CHAR[PWLEN + 1] szPassword;
-    CHAR[DNLEN + 1] szDomain;
+    CHAR[UNLEN + 1] szUserName = 0;
+    CHAR[PWLEN + 1] szPassword = 0;
+    CHAR[DNLEN + 1] szDomain = 0;
 }
 alias RASNOUSERA* LPRASNOUSERA;
 
@@ -130,9 +130,9 @@ struct RASNOUSERW {
     DWORD            dwSize = RASNOUSERW.sizeof;
     DWORD            dwFlags;
     DWORD            dwTimeoutMs;
-    WCHAR[UNLEN + 1] szUserName;
-    WCHAR[PWLEN + 1] szPassword;
-    WCHAR[DNLEN + 1] szDomain;
+    WCHAR[UNLEN + 1] szUserName = 0;
+    WCHAR[PWLEN + 1] szPassword = 0;
+    WCHAR[DNLEN + 1] szDomain = 0;
 }
 alias RASNOUSERW* LPRASNOUSERW;
 
index 11d5bb4ad929edf7572d42a5e4ba988a79957993..b70dc07d14601cfd217c88d94f3b158db1eabaf4 100644 (file)
@@ -90,7 +90,7 @@ union RAS_PARAMS_VALUE {
 }
 
 struct RAS_PARAMETERS {
-    CHAR[RASSAPI_MAX_PARAM_KEY_SIZE] P_Key;
+    CHAR[RASSAPI_MAX_PARAM_KEY_SIZE] P_Key = 0;
     RAS_PARAMS_FORMAT                P_Type;
     BYTE                             P_Attributes;
     RAS_PARAMS_VALUE                 P_Value;
@@ -98,21 +98,21 @@ struct RAS_PARAMETERS {
 
 struct RAS_USER_0 {
     BYTE                                    bfPrivilege;
-    WCHAR[RASSAPI_MAX_PHONENUMBER_SIZE + 1] szPhoneNumber;
+    WCHAR[RASSAPI_MAX_PHONENUMBER_SIZE + 1] szPhoneNumber = 0;
 }
 alias RAS_USER_0* PRAS_USER_0;
 
 struct RAS_PORT_0 {
-    WCHAR[RASSAPI_MAX_PORT_NAME]       wszPortName;
-    WCHAR[RASSAPI_MAX_DEVICETYPE_NAME] wszDeviceType;
-    WCHAR[RASSAPI_MAX_DEVICE_NAME]     wszDeviceName;
-    WCHAR[RASSAPI_MAX_MEDIA_NAME]      wszMediaName;
+    WCHAR[RASSAPI_MAX_PORT_NAME]       wszPortName = 0;
+    WCHAR[RASSAPI_MAX_DEVICETYPE_NAME] wszDeviceType = 0;
+    WCHAR[RASSAPI_MAX_DEVICE_NAME]     wszDeviceName = 0;
+    WCHAR[RASSAPI_MAX_MEDIA_NAME]      wszMediaName = 0;
     DWORD                              reserved;
     DWORD                              Flags;
-    WCHAR[UNLEN + 1]                   wszUserName;
-    WCHAR[NETBIOS_NAME_LEN]            wszComputer;
+    WCHAR[UNLEN + 1]                   wszUserName = 0;
+    WCHAR[NETBIOS_NAME_LEN]            wszComputer = 0;
     DWORD                              dwStartSessionTime; // seconds from 1/1/1970
-    WCHAR[DNLEN + 1]                   wszLogonDomain;
+    WCHAR[DNLEN + 1]                   wszLogonDomain = 0;
     BOOL                               fAdvancedServer;
 }
 alias RAS_PORT_0* PRAS_PORT_0;
@@ -120,23 +120,23 @@ alias RAS_PORT_0* PRAS_PORT_0;
 struct RAS_PPP_NBFCP_RESULT {
     DWORD dwError;
     DWORD dwNetBiosError;
-    CHAR[NETBIOS_NAME_LEN + 1]  szName;
-    WCHAR[NETBIOS_NAME_LEN + 1] wszWksta;
+    CHAR[NETBIOS_NAME_LEN + 1]  szName = 0;
+    WCHAR[NETBIOS_NAME_LEN + 1] wszWksta = 0;
 }
 
 struct RAS_PPP_IPCP_RESULT {
     DWORD dwError;
-    WCHAR[RAS_IPADDRESSLEN + 1] wszAddress;
+    WCHAR[RAS_IPADDRESSLEN + 1] wszAddress = 0;
 }
 
 struct RAS_PPP_IPXCP_RESULT {
     DWORD dwError;
-    WCHAR[RAS_IPXADDRESSLEN + 1] wszAddress;
+    WCHAR[RAS_IPXADDRESSLEN + 1] wszAddress = 0;
 }
 
 struct RAS_PPP_ATCP_RESULT {
     DWORD dwError;
-    WCHAR[RAS_ATADDRESSLEN + 1] wszAddress;
+    WCHAR[RAS_ATADDRESSLEN + 1] wszAddress = 0;
 }
 
 struct RAS_PPP_PROJECTION_RESULT {
index edeb552175b0536e84390386d9c840cf73f8ac61..a05c3b8deaf00ed9aad7d72e6b2fcb0d1ff288f0 100644 (file)
@@ -318,7 +318,7 @@ struct CHARFORMATA {
     COLORREF crTextColor;
     BYTE bCharSet;
     BYTE bPitchAndFamily;
-    char[LF_FACESIZE] szFaceName;
+    char[LF_FACESIZE] szFaceName = 0;
 }
 struct CHARFORMATW {
     UINT cbSize = this.sizeof;
@@ -329,7 +329,7 @@ struct CHARFORMATW {
     COLORREF crTextColor;
     BYTE bCharSet;
     BYTE bPitchAndFamily;
-    WCHAR[LF_FACESIZE] szFaceName;
+    WCHAR[LF_FACESIZE] szFaceName = 0;
 }
 
 struct CHARFORMAT2A {
@@ -341,7 +341,7 @@ struct CHARFORMAT2A {
     COLORREF crTextColor;
     BYTE bCharSet;
     BYTE bPitchAndFamily;
-    char[LF_FACESIZE] szFaceName;
+    char[LF_FACESIZE] szFaceName = 0;
     WORD wWeight;
     SHORT sSpacing;
     COLORREF crBackColor;
@@ -363,7 +363,7 @@ struct CHARFORMAT2W {
     COLORREF crTextColor;
     BYTE bCharSet;
     BYTE bPitchAndFamily;
-    WCHAR[LF_FACESIZE] szFaceName;
+    WCHAR[LF_FACESIZE] szFaceName = 0;
     WORD wWeight;
     SHORT sSpacing;
     COLORREF crBackColor;
index 65fb554442252893e54b2f247228e7c1f963111e..8df96b1635397c2775419e89244d12ce76316bbc 100644 (file)
@@ -904,15 +904,15 @@ alias SP_ALTPLATFORM_INFO* PSP_ALTPLATFORM_INFO;
 
 struct SP_ORIGINAL_FILE_INFO_A {
     DWORD cbSize = SP_ORIGINAL_FILE_INFO_A.sizeof;
-    CHAR[MAX_PATH] OriginalInfName;
-    CHAR[MAX_PATH] OriginalCatalogName;
+    CHAR[MAX_PATH] OriginalInfName = 0;
+    CHAR[MAX_PATH] OriginalCatalogName = 0;
 }
 alias SP_ORIGINAL_FILE_INFO_A* PSP_ORIGINAL_FILE_INFO_A;
 
 struct SP_ORIGINAL_FILE_INFO_W {
     DWORD cbSize = SP_ORIGINAL_FILE_INFO_W.sizeof;
-    WCHAR[MAX_PATH] OriginalInfName;
-    WCHAR[MAX_PATH] OriginalCatalogName;
+    WCHAR[MAX_PATH] OriginalInfName = 0;
+    WCHAR[MAX_PATH] OriginalCatalogName = 0;
 }
 alias SP_ORIGINAL_FILE_INFO_W* PSP_ORIGINAL_FILE_INFO_W;
 
@@ -977,7 +977,7 @@ mixin AlignedStr!(_alignVal, "FILE_IN_CABINET_INFO_A", q{
     WORD  DosDate;
     WORD  DosTime;
     WORD  DosAttribs;
-    CHAR[MAX_PATH] FullTargetName;
+    CHAR[MAX_PATH] FullTargetName = 0;
 });
 alias FILE_IN_CABINET_INFO_A* PFILE_IN_CABINET_INFO_A;
 
@@ -988,7 +988,7 @@ mixin AlignedStr!(_alignVal, "FILE_IN_CABINET_INFO_W", q{
     WORD   DosDate;
     WORD   DosTime;
     WORD   DosAttribs;
-    WCHAR[MAX_PATH] FullTargetName;
+    WCHAR[MAX_PATH] FullTargetName = 0;
 });
 alias FILE_IN_CABINET_INFO_W* PFILE_IN_CABINET_INFO_W;
 
@@ -1044,14 +1044,14 @@ deprecated alias SP_DEVICE_INTERFACE_DATA* PSP_INTERFACE_DEVICE_DATA;
 
 mixin AlignedStr!(_alignVal, "SP_DEVICE_INTERFACE_DETAIL_DATA_A", q{
     DWORD cbSize = SP_DEVICE_INTERFACE_DETAIL_DATA_A.sizeof;
-    CHAR[1] _DevicePath;
+    CHAR[1] _DevicePath = 0;
     CHAR* DevicePath() return { return _DevicePath.ptr; }
 });
 alias SP_DEVICE_INTERFACE_DETAIL_DATA_A* PSP_DEVICE_INTERFACE_DETAIL_DATA_A;
 
 mixin AlignedStr!(_alignVal, "SP_DEVICE_INTERFACE_DETAIL_DATA_W", q{
     DWORD  cbSize = SP_DEVICE_INTERFACE_DETAIL_DATA_W.sizeof;
-    WCHAR[1] _DevicePath;
+    WCHAR[1] _DevicePath = 0;
     WCHAR* DevicePath() return { return _DevicePath.ptr; }
 });
 alias SP_DEVICE_INTERFACE_DETAIL_DATA_W* PSP_DEVICE_INTERFACE_DETAIL_DATA_W;
@@ -1065,7 +1065,7 @@ mixin AlignedStr!(_alignVal, "SP_DEVINFO_LIST_DETAIL_DATA_A", q{
     DWORD  cbSize = SP_DEVINFO_LIST_DETAIL_DATA_A.sizeof;
     GUID   ClassGuid;
     HANDLE RemoteMachineHandle;
-    CHAR[SP_MAX_MACHINENAME_LENGTH] RemoteMachineName;
+    CHAR[SP_MAX_MACHINENAME_LENGTH] RemoteMachineName = 0;
 });
 alias SP_DEVINFO_LIST_DETAIL_DATA_A* PSP_DEVINFO_LIST_DETAIL_DATA_A;
 
@@ -1073,7 +1073,7 @@ mixin AlignedStr!(_alignVal, "SP_DEVINFO_LIST_DETAIL_DATA_W", q{
     DWORD  cbSize = SP_DEVINFO_LIST_DETAIL_DATA_W.sizeof;
     GUID   ClassGuid;
     HANDLE RemoteMachineHandle;
-    WCHAR[SP_MAX_MACHINENAME_LENGTH] RemoteMachineName;
+    WCHAR[SP_MAX_MACHINENAME_LENGTH] RemoteMachineName = 0;
 });
 alias SP_DEVINFO_LIST_DETAIL_DATA_W* PSP_DEVINFO_LIST_DETAIL_DATA_W;
 
@@ -1090,7 +1090,7 @@ struct SP_DEVINSTALL_PARAMS_A {
     HSPFILEQ            FileQueue;
     ULONG_PTR           ClassInstallReserved;
     DWORD               Reserved;
-    CHAR[MAX_PATH]      DriverPath;
+    CHAR[MAX_PATH]      DriverPath = 0;
 }
 alias SP_DEVINSTALL_PARAMS_A* PSP_DEVINSTALL_PARAMS_A;
 
@@ -1104,7 +1104,7 @@ struct SP_DEVINSTALL_PARAMS_W {
     HSPFILEQ            FileQueue;
     ULONG_PTR           ClassInstallReserved;
     DWORD               Reserved;
-    WCHAR[MAX_PATH]     DriverPath;
+    WCHAR[MAX_PATH]     DriverPath = 0;
 }
 alias SP_DEVINSTALL_PARAMS_W* PSP_DEVINSTALL_PARAMS_W;
 
@@ -1151,20 +1151,20 @@ alias SP_UNREMOVEDEVICE_PARAMS* PSP_UNREMOVEDEVICE_PARAMS;
 
 struct SP_SELECTDEVICE_PARAMS_A {
     SP_CLASSINSTALL_HEADER    ClassInstallHeader;
-    CHAR[MAX_TITLE_LEN]       Title;
-    CHAR[MAX_INSTRUCTION_LEN] Instructions;
-    CHAR[MAX_LABEL_LEN]       ListLabel;
-    CHAR[MAX_SUBTITLE_LEN]    SubTitle;
+    CHAR[MAX_TITLE_LEN]       Title = 0;
+    CHAR[MAX_INSTRUCTION_LEN] Instructions = 0;
+    CHAR[MAX_LABEL_LEN]       ListLabel = 0;
+    CHAR[MAX_SUBTITLE_LEN]    SubTitle = 0;
     BYTE[2]                   Reserved;
 }
 alias SP_SELECTDEVICE_PARAMS_A* PSP_SELECTDEVICE_PARAMS_A;
 
 struct SP_SELECTDEVICE_PARAMS_W {
     SP_CLASSINSTALL_HEADER     ClassInstallHeader;
-    WCHAR[MAX_TITLE_LEN]       Title;
-    WCHAR[MAX_INSTRUCTION_LEN] Instructions;
-    WCHAR[MAX_LABEL_LEN]       ListLabel;
-    WCHAR[MAX_SUBTITLE_LEN]    SubTitle;
+    WCHAR[MAX_TITLE_LEN]       Title = 0;
+    WCHAR[MAX_INSTRUCTION_LEN] Instructions = 0;
+    WCHAR[MAX_LABEL_LEN]       ListLabel = 0;
+    WCHAR[MAX_SUBTITLE_LEN]    SubTitle = 0;
 }
 alias SP_SELECTDEVICE_PARAMS_W* PSP_SELECTDEVICE_PARAMS_W;
 
@@ -1202,27 +1202,27 @@ alias SP_NEWDEVICEWIZARD_DATA* PSP_ADDPROPERTYPAGE_DATA;
 
 struct SP_TROUBLESHOOTER_PARAMS_A {
     SP_CLASSINSTALL_HEADER ClassInstallHeader;
-    CHAR[MAX_PATH]         ChmFile;
-    CHAR[MAX_PATH]         HtmlTroubleShooter;
+    CHAR[MAX_PATH]         ChmFile = 0;
+    CHAR[MAX_PATH]         HtmlTroubleShooter = 0;
 }
 alias SP_TROUBLESHOOTER_PARAMS_A* PSP_TROUBLESHOOTER_PARAMS_A;
 
 struct SP_TROUBLESHOOTER_PARAMS_W {
     SP_CLASSINSTALL_HEADER ClassInstallHeader;
-    WCHAR[MAX_PATH]        ChmFile;
-    WCHAR[MAX_PATH]        HtmlTroubleShooter;
+    WCHAR[MAX_PATH]        ChmFile = 0;
+    WCHAR[MAX_PATH]        HtmlTroubleShooter = 0;
 }
 alias SP_TROUBLESHOOTER_PARAMS_W* PSP_TROUBLESHOOTER_PARAMS_W;
 
 struct SP_POWERMESSAGEWAKE_PARAMS_A {
     SP_CLASSINSTALL_HEADER ClassInstallHeader;
-    CHAR[LINE_LEN*2]       PowerMessageWake;
+    CHAR[LINE_LEN*2]       PowerMessageWake = 0;
 }
 alias SP_POWERMESSAGEWAKE_PARAMS_A* PSP_POWERMESSAGEWAKE_PARAMS_A;
 
 struct SP_POWERMESSAGEWAKE_PARAMS_W {
     SP_CLASSINSTALL_HEADER ClassInstallHeader;
-    WCHAR[LINE_LEN*2]      PowerMessageWake;
+    WCHAR[LINE_LEN*2]      PowerMessageWake = 0;
 }
 alias SP_POWERMESSAGEWAKE_PARAMS_W* PSP_POWERMESSAGEWAKE_PARAMS_W;
 
@@ -1230,9 +1230,9 @@ mixin AlignedStr!(_alignVal, "SP_DRVINFO_DATA_V2_A", q{
     DWORD          cbSize = SP_DRVINFO_DATA_V2_A.sizeof;
     DWORD          DriverType;
     ULONG_PTR      Reserved;
-    CHAR[LINE_LEN] Description;
-    CHAR[LINE_LEN] MfgName;
-    CHAR[LINE_LEN] ProviderName;
+    CHAR[LINE_LEN] Description = 0;
+    CHAR[LINE_LEN] MfgName = 0;
+    CHAR[LINE_LEN] ProviderName = 0;
     FILETIME       DriverDate;
     DWORDLONG      DriverVersion;
 });
@@ -1242,9 +1242,9 @@ mixin AlignedStr!(_alignVal, "SP_DRVINFO_DATA_V2_W", q{
     DWORD           cbSize = SP_DRVINFO_DATA_V2_A.sizeof;
     DWORD           DriverType;
     ULONG_PTR       Reserved;
-    WCHAR[LINE_LEN] Description;
-    WCHAR[LINE_LEN] MfgName;
-    WCHAR[LINE_LEN] ProviderName;
+    WCHAR[LINE_LEN] Description = 0;
+    WCHAR[LINE_LEN] MfgName = 0;
+    WCHAR[LINE_LEN] ProviderName = 0;
     FILETIME        DriverDate;
     DWORDLONG       DriverVersion;
 });
@@ -1254,9 +1254,9 @@ struct SP_DRVINFO_DATA_V1_A {
     DWORD          cbSize = SP_DRVINFO_DATA_V1_A.sizeof;
     DWORD          DriverType;
     ULONG_PTR      Reserved;
-    CHAR[LINE_LEN] Description;
-    CHAR[LINE_LEN] MfgName;
-    CHAR[LINE_LEN] ProviderName;
+    CHAR[LINE_LEN] Description = 0;
+    CHAR[LINE_LEN] MfgName = 0;
+    CHAR[LINE_LEN] ProviderName = 0;
 }
 alias SP_DRVINFO_DATA_V1_A* PSP_DRVINFO_DATA_V1_A;
 
@@ -1264,9 +1264,9 @@ struct SP_DRVINFO_DATA_V1_W {
     DWORD           cbSize = SP_DRVINFO_DATA_V1_W.sizeof;
     DWORD           DriverType;
     ULONG_PTR       Reserved;
-    WCHAR[LINE_LEN] Description;
-    WCHAR[LINE_LEN] MfgName;
-    WCHAR[LINE_LEN] ProviderName;
+    WCHAR[LINE_LEN] Description = 0;
+    WCHAR[LINE_LEN] MfgName = 0;
+    WCHAR[LINE_LEN] ProviderName = 0;
 }
 alias SP_DRVINFO_DATA_V1_W* PSP_DRVINFO_DATA_V1_W;
 
@@ -1304,10 +1304,10 @@ mixin AlignedStr!(_alignVal, "SP_DRVINFO_DETAIL_DATA_A", q{
     DWORD          CompatIDsOffset;
     DWORD          CompatIDsLength;
     ULONG_PTR      Reserved;
-    CHAR[LINE_LEN] SectionName;
-    CHAR[MAX_PATH] InfFileName;
-    CHAR[LINE_LEN] DrvDescription;
-    CHAR[1]        _HardwareID;
+    CHAR[LINE_LEN] SectionName = 0;
+    CHAR[MAX_PATH] InfFileName = 0;
+    CHAR[LINE_LEN] DrvDescription = 0;
+    CHAR[1]        _HardwareID = 0;
     CHAR*          HardwareID() return { return _HardwareID.ptr; }
 });
 alias SP_DRVINFO_DETAIL_DATA_A* PSP_DRVINFO_DETAIL_DATA_A;
@@ -1318,10 +1318,10 @@ mixin AlignedStr!(_alignVal, "SP_DRVINFO_DETAIL_DATA_W", q{
     DWORD           CompatIDsOffset;
     DWORD           CompatIDsLength;
     ULONG_PTR       Reserved;
-    WCHAR[LINE_LEN] SectionName;
-    WCHAR[MAX_PATH] InfFileName;
-    WCHAR[LINE_LEN] DrvDescription;
-    WCHAR[1]        _HardwareID;
+    WCHAR[LINE_LEN] SectionName = 0;
+    WCHAR[MAX_PATH] InfFileName = 0;
+    WCHAR[LINE_LEN] DrvDescription = 0;
+    WCHAR[1]        _HardwareID = 0;
     WCHAR*          HardwareID() return { return _HardwareID.ptr; }
 });
 alias SP_DRVINFO_DETAIL_DATA_W* PSP_DRVINFO_DETAIL_DATA_W;
@@ -1359,14 +1359,14 @@ alias SP_PROPSHEETPAGE_REQUEST* PSP_PROPSHEETPAGE_REQUEST;
 
 struct SP_BACKUP_QUEUE_PARAMS_A {
     DWORD cbSize = SP_BACKUP_QUEUE_PARAMS_A.sizeof;
-    CHAR[MAX_PATH] FullInfPath;
+    CHAR[MAX_PATH] FullInfPath = 0;
     INT FilenameOffset;
 }
 alias SP_BACKUP_QUEUE_PARAMS_A* PSP_BACKUP_QUEUE_PARAMS_A;
 
 struct SP_BACKUP_QUEUE_PARAMS_W {
     DWORD cbSize = SP_BACKUP_QUEUE_PARAMS_W.sizeof;
-    WCHAR[MAX_PATH] FullInfPath;
+    WCHAR[MAX_PATH] FullInfPath = 0;
     INT FilenameOffset;
 }
 alias SP_BACKUP_QUEUE_PARAMS_W* PSP_BACKUP_QUEUE_PARAMS_W;
index ba78cc4e72102c89537eca338d6fbfdb9d8345fe..26c6f78c40403bda42874ebf65577f407caa664e 100644 (file)
@@ -210,18 +210,18 @@ struct NOTIFYICONDATAA {
     UINT  uCallbackMessage;
     HICON hIcon;
     static if (_WIN32_IE >= 0x500) {
-        CHAR[128] szTip;
+        CHAR[128] szTip = 0;
         DWORD     dwState;
         DWORD     dwStateMask;
-        CHAR[256] szInfo;
+        CHAR[256] szInfo = 0;
         union {
             UINT  uTimeout;
             UINT  uVersion;
         }
-        CHAR[64]  szInfoTitle;
+        CHAR[64]  szInfoTitle = 0;
         DWORD     dwInfoFlags;
     } else {
-        CHAR[64]  szTip;
+        CHAR[64]  szTip = 0;
     }
     static if (_WIN32_IE >= 0x600) {
         GUID      guidItem;
@@ -237,18 +237,18 @@ struct NOTIFYICONDATAW {
     UINT  uCallbackMessage;
     HICON hIcon;
     static if (_WIN32_IE >= 0x500) {
-        WCHAR[128] szTip;
+        WCHAR[128] szTip = 0;
         DWORD      dwState;
         DWORD      dwStateMask;
-        WCHAR[256] szInfo;
+        WCHAR[256] szInfo = 0;
         union {
             UINT   uTimeout;
             UINT   uVersion;
         }
-        WCHAR[64]  szInfoTitle;
+        WCHAR[64]  szInfoTitle = 0;
         DWORD      dwInfoFlags;
     } else {
-        WCHAR[64]  szTip;
+        WCHAR[64]  szTip = 0;
     }
     static if (_WIN32_IE >= 0x600) {
         GUID guidItem;
@@ -332,16 +332,16 @@ struct SHFILEINFOA {
     HICON          hIcon;
     int            iIcon;
     DWORD          dwAttributes;
-    CHAR[MAX_PATH] szDisplayName;
-    CHAR[80]       szTypeName;
+    CHAR[MAX_PATH] szDisplayName = 0;
+    CHAR[80]       szTypeName = 0;
 }
 
 struct SHFILEINFOW {
     HICON           hIcon;
     int             iIcon;
     DWORD           dwAttributes;
-    WCHAR[MAX_PATH] szDisplayName;
-    WCHAR[80]       szTypeName;
+    WCHAR[MAX_PATH] szDisplayName = 0;
+    WCHAR[80]       szTypeName = 0;
 }
 
 align(1) struct SHQUERYRBINFO {
index 0745b706e84131ca4bb02bd29d33f0ae04ddfd9f..ff7f8985c359624259d595175123e39e5ce1b95c 100644 (file)
@@ -507,7 +507,7 @@ struct FILEDESCRIPTORA {
     FILETIME ftLastWriteTime;
     DWORD nFileSizeHigh;
     DWORD nFileSizeLow;
-    CHAR[MAX_PATH] cFileName;
+    CHAR[MAX_PATH] cFileName = 0;
 }
 alias FILEDESCRIPTORA* LPFILEDESCRIPTORA;
 
@@ -522,7 +522,7 @@ struct FILEDESCRIPTORW {
     FILETIME ftLastWriteTime;
     DWORD nFileSizeHigh;
     DWORD nFileSizeLow;
-    WCHAR[MAX_PATH] cFileName;
+    WCHAR[MAX_PATH] cFileName = 0;
 }
 alias FILEDESCRIPTORW* LPFILEDESCRIPTORW;
 
@@ -594,7 +594,7 @@ struct FVSHOWINFO {
     DWORD dwFlags;
     RECT rect;
     LPUNKNOWN punkRel;
-    OLECHAR[MAX_PATH] strNewFile;
+    OLECHAR[MAX_PATH] strNewFile = 0;
 }
 alias FVSHOWINFO* LPFVSHOWINFO;
 
@@ -632,8 +632,8 @@ static if (_WIN32_IE >= 0x500) {
     struct EXTRASEARCH
      {
         GUID guidSearch;
-        WCHAR[80] wszFriendlyName;
-        WCHAR[2084] wszUrl;
+        WCHAR[80] wszFriendlyName = 0;
+        WCHAR[2084] wszUrl = 0;
     }
     alias EXTRASEARCH* LPEXTRASEARCH;
 
@@ -656,8 +656,8 @@ static if (_WIN32_IE >= 0x500) {
     struct PERSIST_FOLDER_TARGET_INFO
      {
         LPITEMIDLIST pidlTargetFolder;
-        WCHAR[MAX_PATH] szTargetParsingName;
-        WCHAR[MAX_PATH] szNetworkProvider;
+        WCHAR[MAX_PATH] szTargetParsingName = 0;
+        WCHAR[MAX_PATH] szNetworkProvider = 0;
         DWORD dwAttributes;
         int csidl;
     }
@@ -699,7 +699,7 @@ static if (_WIN32_IE >= 0x500) {
         struct SHCOLUMNINIT {
             ULONG dwFlags;
             ULONG dwReserved;
-            WCHAR[MAX_PATH] wszFolder;
+            WCHAR[MAX_PATH] wszFolder = 0;
         }
         alias SHCOLUMNINIT*        LPSHCOLUMNINIT;
         alias const(SHCOLUMNINIT)* LPCSHCOLUMNINIT;
@@ -708,8 +708,8 @@ static if (_WIN32_IE >= 0x500) {
             ULONG dwFlags;
             DWORD dwFileAttributes;
             ULONG dwReserved;
-            WCHAR *pwszExt;
-            WCHAR[MAX_PATH] wszFile;
+            WCHAR *pwszExt = 0;
+            WCHAR[MAX_PATH] wszFile = 0;
         }
         alias SHCOLUMNDATA*        LPSHCOLUMNDATA;
         alias const(SHCOLUMNDATA)* LPCSHCOLUMNDATA;
@@ -725,8 +725,8 @@ enum MAX_COLUMN_DESC_LEN = 128;
         DWORD fmt;
         UINT cChars;
         DWORD csFlags;
-        WCHAR[MAX_COLUMN_NAME_LEN] wszTitle;
-        WCHAR[MAX_COLUMN_DESC_LEN] wszDescription;
+        WCHAR[MAX_COLUMN_NAME_LEN] wszTitle = 0;
+        WCHAR[MAX_COLUMN_DESC_LEN] wszDescription = 0;
     }
     alias SHCOLUMNINFO*        LPSHCOLUMNINFO;
     alias const(SHCOLUMNINFO)* LPCSHCOLUMNINFO;
index 09901507f9ea16b3f52052452b50ef3d54b7683f..4f550184d0acc4af69f8fd62ccd3794b0778dea7 100644 (file)
@@ -10,7 +10,9 @@
 module core.sys.windows.snmp;
 version (Windows):
 
-private import core.sys.windows.windows;
+private import core.sys.windows.basetsd /+: HANDLE+/;
+private import core.sys.windows.windef /+: BOOL, BYTE, DWORD, INT, LONG, UINT, ULONG+/;
+private import core.sys.windows.winnt /+: LPSTR, LPVOID, ULARGE_INTEGER, VOID+/;
 
 // These are not documented on MSDN
 enum {
index 13f33edc3e06cb89ad4b042ab91e59575ce679e1..d354ffecfe3e3e8a9a04cc5d6b2964c062999531 100644 (file)
@@ -17,7 +17,9 @@ import core.runtime;
 import core.stdc.stdlib;
 import core.stdc.string;
 import core.sys.windows.dbghelp;
-import core.sys.windows.windows;
+import core.sys.windows.imagehlp /+: ADDRESS_MODE+/;
+import core.sys.windows.winbase;
+import core.sys.windows.windef;
 
 //debug=PRINTF;
 debug(PRINTF) import core.stdc.stdio;
@@ -243,7 +245,7 @@ private:
         {
         align(1):
             IMAGEHLP_SYMBOLA64 _base;
-            TCHAR[1024] _buf;
+            TCHAR[1024] _buf = void;
         }
         BufSymbol bufSymbol=void;
         IMAGEHLP_SYMBOLA64* symbol = &bufSymbol._base;
@@ -358,7 +360,7 @@ private string generateSearchPath()
                                            "SYSTEMROOT"];
 
     string path;
-    char[2048] temp;
+    char[2048] temp = void;
     DWORD len;
 
     foreach ( e; defaultPathList )
index 39e8beb6c2bc52bef0dbff737a59dc7d4db87720..9d39a90619a8f0a38c903ed8b3c92200809f0116 100644 (file)
@@ -131,12 +131,12 @@ enum USER_SESSION_KEY_LENGTH = CYPHER_BLOCK_LENGTH * 2;
 enum CLEAR_BLOCK_LENGTH = 8;
 
 struct CYPHER_BLOCK {
-    CHAR[CYPHER_BLOCK_LENGTH] data;
+    CHAR[CYPHER_BLOCK_LENGTH] data = 0;
 }
 alias CYPHER_BLOCK* PCYPHER_BLOCK;
 
 struct CLEAR_BLOCK {
-    CHAR[CLEAR_BLOCK_LENGTH] data;
+    CHAR[CLEAR_BLOCK_LENGTH] data = 0;
 }
 alias CLEAR_BLOCK* PCLEAR_BLOCK;
 
index 491a02b74442845fb5cfda43c92f6d7d89a716e3..4e887b7be4e44c820bb8fdcacf8015334cbc102f 100644 (file)
 module core.sys.windows.threadaux;
 version (Windows):
 
-import core.sys.windows.windows;
+import core.sys.windows.basetsd/+ : HANDLE+/;
+import core.sys.windows.winbase/+ : CloseHandle, GetCurrentThreadId, GetCurrentProcessId,
+    GetModuleHandleA, GetProcAddress+/;
+import core.sys.windows.windef/+ : BOOL, DWORD, FALSE, HRESULT+/;
 import core.stdc.stdlib;
 
 public import core.thread;
index db571e075e862278667b44e75755fe30f196141b..3a3959f8deb9e238ea1503052c6b012e8cf99d70 100644 (file)
@@ -69,7 +69,7 @@ struct PROCESSENTRY32W {
     DWORD th32ParentProcessID;
     LONG pcPriClassBase;
     DWORD dwFlags;
-    WCHAR[MAX_PATH] szExeFile;
+    WCHAR[MAX_PATH] szExeFile = 0;
 }
 alias PROCESSENTRY32W* PPROCESSENTRY32W;
 alias PROCESSENTRY32W* LPPROCESSENTRY32W;
@@ -95,8 +95,8 @@ struct MODULEENTRY32W {
     BYTE *modBaseAddr;
     DWORD modBaseSize;
     HMODULE hModule;
-    WCHAR[MAX_MODULE_NAME32 + 1] szModule;
-    WCHAR[MAX_PATH] szExePath;
+    WCHAR[MAX_MODULE_NAME32 + 1] szModule = 0;
+    WCHAR[MAX_PATH] szExePath = 0;
 }
 alias MODULEENTRY32W* PMODULEENTRY32W;
 alias MODULEENTRY32W* LPMODULEENTRY32W;
@@ -120,7 +120,7 @@ version (Unicode) {
         DWORD th32ParentProcessID;
         LONG pcPriClassBase;
         DWORD dwFlags;
-        CHAR[MAX_PATH] szExeFile;
+        CHAR[MAX_PATH] szExeFile = 0;
     }
     alias PROCESSENTRY32* PPROCESSENTRY32;
     alias PROCESSENTRY32* LPPROCESSENTRY32;
@@ -134,8 +134,8 @@ version (Unicode) {
         BYTE *modBaseAddr;
         DWORD modBaseSize;
         HMODULE hModule;
-        char[MAX_MODULE_NAME32 + 1] szModule;
-        char[MAX_PATH] szExePath;
+        char[MAX_MODULE_NAME32 + 1] szModule = 0;
+        char[MAX_PATH] szExePath = 0;
     }
     alias MODULEENTRY32* PMODULEENTRY32;
     alias MODULEENTRY32* LPMODULEENTRY32;
index d45f1c3dd62b54e93397bd733656b55593469d84..4d168b38a869375ae745f8ce6ea3626bf312a4ea 100644 (file)
@@ -189,9 +189,9 @@ struct ICINFO {
     DWORD   dwFlags;
     DWORD   dwVersion;
     DWORD   dwVersionICM;
-    WCHAR[16]   szName;
-    WCHAR[128]  szDescription;
-    WCHAR[128]  szDriver;
+    WCHAR[16]   szName = 0;
+    WCHAR[128]  szDescription = 0;
+    WCHAR[128]  szDriver = 0;
 }
 
 enum {
@@ -890,7 +890,7 @@ struct AVISTREAMINFOW {
     RECT    rcFrame;
     DWORD   dwEditCount;
     DWORD   dwFormatChangeCount;
-    WCHAR[64]   szName;
+    WCHAR[64]   szName = 0;
 }
 alias AVISTREAMINFOW* LPAVISTREAMINFOW;
 
@@ -912,7 +912,7 @@ struct AVISTREAMINFOA {
     RECT    rcFrame;
     DWORD   dwEditCount;
     DWORD   dwFormatChangeCount;
-    char[64]    szName;
+    char[64]    szName = 0;
 }
 alias AVISTREAMINFOA* LPAVISTREAMINFOA;
 
@@ -939,7 +939,7 @@ struct AVIFILEINFOW {
     DWORD   dwRate;
     DWORD   dwLength;
     DWORD   dwEditCount;
-    WCHAR[64]   szFileType;
+    WCHAR[64]   szFileType = 0;
 }
 alias AVIFILEINFOW* LPAVIFILEINFOW;
 
@@ -955,7 +955,7 @@ struct AVIFILEINFOA {
     DWORD   dwRate;
     DWORD   dwLength;
     DWORD   dwEditCount;
-    char[64]    szFileType;
+    char[64]    szFileType = 0;
 }
 alias AVIFILEINFOA* LPAVIFILEINFOA;
 
index 753f511542b84ddf750ea2b83e5ea2b65120c821..280c4684b33e1a90ee6603cb8c07fc0a36d10794 100644 (file)
@@ -149,7 +149,7 @@ struct COMMPROP {
     DWORD dwCurrentRxQueue;
     DWORD dwProvSpec1;
     DWORD dwProvSpec2;
-    WCHAR _wcProvChar;
+    WCHAR _wcProvChar = 0;
 
     WCHAR* wcProvChar() return { return &_wcProvChar; }
 }
@@ -968,11 +968,11 @@ struct DCB {
     BYTE ByteSize;
     BYTE Parity;
     BYTE StopBits;
-    char XonChar;
-    char XoffChar;
-    char ErrorChar;
-    char EofChar;
-    char EvtChar;
+    char XonChar = 0;
+    char XoffChar = 0;
+    char ErrorChar = 0;
+    char EofChar = 0;
+    char EvtChar = 0;
     WORD wReserved1;
 }
 alias DCB* LPDCB;
@@ -985,7 +985,7 @@ struct COMMCONFIG {
     DWORD dwProviderSubType;
     DWORD dwProviderOffset;
     DWORD dwProviderSize;
-    WCHAR _wcProviderData;
+    WCHAR _wcProviderData = 0;
 
     WCHAR* wcProviderData() return { return &_wcProviderData; }
 }
@@ -1247,9 +1247,9 @@ struct WIN32_FIND_DATAA {
     DWORD          dwReserved0;
     DWORD          dwReserved1;
 // #endif
-    CHAR[MAX_PATH] cFileName;
+    CHAR[MAX_PATH] cFileName = 0;
 // #ifndef _WIN32_WCE
-    CHAR[14]       cAlternateFileName;
+    CHAR[14]       cAlternateFileName = 0;
 // #endif
 }
 alias WIN32_FIND_DATAA* PWIN32_FIND_DATAA, LPWIN32_FIND_DATAA;
@@ -1267,9 +1267,9 @@ struct WIN32_FIND_DATAW {
     DWORD           dwReserved0;
     DWORD           dwReserved1;
 // #endif
-    WCHAR[MAX_PATH] cFileName;
+    WCHAR[MAX_PATH] cFileName = 0;
 // #ifndef _WIN32_WCE
-    WCHAR[14]       cAlternateFileName;
+    WCHAR[14]       cAlternateFileName = 0;
 // #endif
 }
 alias WIN32_FIND_DATAW* PWIN32_FIND_DATAW, LPWIN32_FIND_DATAW;
@@ -1279,7 +1279,7 @@ struct WIN32_STREAM_ID {
     DWORD         dwStreamAttributes;
     LARGE_INTEGER Size;
     DWORD         dwStreamNameSize;
-    WCHAR         _cStreamName;
+    WCHAR         _cStreamName = 0;
 
     WCHAR* cStreamName() return { return &_cStreamName; }
 }
@@ -1304,15 +1304,15 @@ enum ACL_INFORMATION_CLASS {
 
 struct HW_PROFILE_INFOA {
     DWORD dwDockInfo;
-    CHAR[HW_PROFILE_GUIDLEN] szHwProfileGuid;
-    CHAR[MAX_PROFILE_LEN]    szHwProfileName;
+    CHAR[HW_PROFILE_GUIDLEN] szHwProfileGuid = 0;
+    CHAR[MAX_PROFILE_LEN]    szHwProfileName = 0;
 }
 alias HW_PROFILE_INFOA* LPHW_PROFILE_INFOA;
 
 struct HW_PROFILE_INFOW {
     DWORD dwDockInfo;
-    WCHAR[HW_PROFILE_GUIDLEN] szHwProfileGuid;
-    WCHAR[MAX_PROFILE_LEN]    szHwProfileName;
+    WCHAR[HW_PROFILE_GUIDLEN] szHwProfileGuid = 0;
+    WCHAR[MAX_PROFILE_LEN]    szHwProfileName = 0;
 }
 alias HW_PROFILE_INFOW* LPHW_PROFILE_INFOW;
 
@@ -1358,10 +1358,10 @@ static if (_WIN32_WINNT >= 0x500) {
 
 struct TIME_ZONE_INFORMATION {
     LONG       Bias;
-    WCHAR[32]  StandardName;
+    WCHAR[32]  StandardName = 0;
     SYSTEMTIME StandardDate;
     LONG       StandardBias;
-    WCHAR[32]  DaylightName;
+    WCHAR[32]  DaylightName = 0;
     SYSTEMTIME DaylightDate;
     LONG       DaylightBias;
 }
@@ -1492,7 +1492,7 @@ struct OFSTRUCT {
     WORD      nErrCode;
     WORD      Reserved1;
     WORD      Reserved2;
-    CHAR[128] szPathName; // const OFS_MAXPATHNAME = 128;
+    CHAR[128] szPathName = 0; // const OFS_MAXPATHNAME = 128;
 }
 alias OFSTRUCT* LPOFSTRUCT, POFSTRUCT;
 
index 08061f4ecabaf8880a83573d586814a6effbdb1b..6b06c14b166ae4eeb5de3058d428a66934b4d38c 100644 (file)
@@ -107,7 +107,7 @@ enum {
 
 struct CHAR_INFO {
     union _Char {
-        WCHAR UnicodeChar;
+        WCHAR UnicodeChar = 0;
         CHAR AsciiChar;
     }
     union {
@@ -162,11 +162,11 @@ struct KEY_EVENT_RECORD {
     WORD  wVirtualKeyCode;
     WORD  wVirtualScanCode;
     union _uChar {
-        WCHAR UnicodeChar;
+        WCHAR UnicodeChar = 0;
         CHAR  AsciiChar;
     }
     union {
-        WCHAR UnicodeChar;
+        WCHAR UnicodeChar = 0;
         CHAR  AsciiChar;
         _uChar uChar;
     }
index e1f58b97e077cd52b7d5b48b50b27e43a40e0218..0651ea803cfb6f17f082e96cc20b598714aeb339 100644 (file)
@@ -795,7 +795,7 @@ struct PROV_ENUMALGS {
     ALG_ID   aiAlgid;
     DWORD    dwBitLen;
     DWORD    dwNameLen;
-    CHAR[20] szName;
+    CHAR[20] szName = 0;
 }
 
 struct PUBLICKEYSTRUC {
index 55b10f97bbafedae6e63413ec8d75488cac7ada4..e495b2be84ffe849e0f69418de1813bc6f8fb22e 100644 (file)
@@ -2217,7 +2217,7 @@ struct DEVMODEA {
 alias DEVMODEA* PDEVMODEA, NPDEVMODEA, LPDEVMODEA;
 
 struct DEVMODEW {
-    WCHAR[CCHDEVICENAME]   dmDeviceName;
+    WCHAR[CCHDEVICENAME]   dmDeviceName = 0;
     WORD   dmSpecVersion;
     WORD   dmDriverVersion;
     WORD   dmSize;
@@ -2246,7 +2246,7 @@ struct DEVMODEW {
     short  dmYResolution;
     short  dmTTOption;
     short  dmCollate;
-    WCHAR[CCHFORMNAME]  dmFormName;
+    WCHAR[CCHFORMNAME]  dmFormName = 0;
     WORD   dmLogPixels;
     DWORD  dmBitsPerPel;
     DWORD  dmPelsWidth;
@@ -2344,7 +2344,7 @@ struct LOGFONTA {
     BYTE lfClipPrecision;
     BYTE lfQuality;
     BYTE lfPitchAndFamily;
-    CHAR[LF_FACESIZE] lfFaceName;
+    CHAR[LF_FACESIZE] lfFaceName = 0;
 }
 alias LOGFONTA* PLOGFONTA, NPLOGFONTA, LPLOGFONTA;
 
@@ -2362,7 +2362,7 @@ struct LOGFONTW {
     BYTE lfClipPrecision;
     BYTE lfQuality;
     BYTE lfPitchAndFamily;
-    WCHAR[LF_FACESIZE] lfFaceName;
+    WCHAR[LF_FACESIZE] lfFaceName = 0;
 }
 alias LOGFONTW* PLOGFONTW, NPLOGFONTW, LPLOGFONTW;
 
@@ -2382,8 +2382,8 @@ alias EXTLOGFONTA* PEXTLOGFONTA, NPEXTLOGFONTA, LPEXTLOGFONTA;
 
 struct EXTLOGFONTW {
     LOGFONTW               elfLogFont;
-    WCHAR[LF_FULLFACESIZE] elfFullName;
-    WCHAR[LF_FACESIZE]     elfStyle;
+    WCHAR[LF_FULLFACESIZE] elfFullName = 0;
+    WCHAR[LF_FACESIZE]     elfStyle = 0;
     DWORD                  elfVersion;
     DWORD                  elfStyleSize;
     DWORD                  elfMatch;
@@ -2497,7 +2497,7 @@ struct LOGCOLORSPACEA {
     DWORD lcsGammaRed;
     DWORD lcsGammaGreen;
     DWORD lcsGammaBlue;
-    CHAR[MAX_PATH] lcsFilename;
+    CHAR[MAX_PATH] lcsFilename = 0;
 }
 alias LOGCOLORSPACEA* LPLOGCOLORSPACEA;
 
@@ -2511,7 +2511,7 @@ struct LOGCOLORSPACEW {
     DWORD lcsGammaRed;
     DWORD lcsGammaGreen;
     DWORD lcsGammaBlue;
-    WCHAR[MAX_PATH] lcsFilename;
+    WCHAR[MAX_PATH] lcsFilename = 0;
 }
 alias LOGCOLORSPACEW* LPLOGCOLORSPACEW;
 
@@ -3376,10 +3376,10 @@ struct TEXTMETRICW {
     LONG tmOverhang;
     LONG tmDigitizedAspectX;
     LONG tmDigitizedAspectY;
-    WCHAR tmFirstChar;
-    WCHAR tmLastChar;
-    WCHAR tmDefaultChar;
-    WCHAR tmBreakChar;
+    WCHAR tmFirstChar = 0;
+    WCHAR tmLastChar = 0;
+    WCHAR tmDefaultChar = 0;
+    WCHAR tmBreakChar = 0;
     BYTE tmItalic;
     BYTE tmUnderlined;
     BYTE tmStruckOut;
@@ -3399,7 +3399,7 @@ alias RGNDATAHEADER* PRGNDATAHEADER;
 
 struct RGNDATA {
     RGNDATAHEADER rdh;
-    char[1] Buffer;
+    char[1] Buffer = 0;
 }
 alias RGNDATA* PRGNDATA, NPRGNDATA, LPRGNDATA;
 
@@ -3442,7 +3442,7 @@ alias GLYPHMETRICS* LPGLYPHMETRICS;
 
 static if (_WIN32_WINNT >= 0x500) {
     struct WCRANGE {
-        WCHAR  wcLow;
+        WCHAR  wcLow = 0;
         USHORT cGlyphs;
     }
     alias WCRANGE* PWCRANGE, LPWCRANGE;
@@ -3668,10 +3668,10 @@ struct NEWTEXTMETRICW {
     LONG tmOverhang;
     LONG tmDigitizedAspectX;
     LONG tmDigitizedAspectY;
-    WCHAR tmFirstChar;
-    WCHAR tmLastChar;
-    WCHAR tmDefaultChar;
-    WCHAR tmBreakChar;
+    WCHAR tmFirstChar = 0;
+    WCHAR tmLastChar = 0;
+    WCHAR tmDefaultChar = 0;
+    WCHAR tmBreakChar = 0;
     BYTE tmItalic;
     BYTE tmUnderlined;
     BYTE tmStruckOut;
@@ -3713,8 +3713,8 @@ alias ENUMLOGFONTA* LPENUMLOGFONTA;
 
 struct ENUMLOGFONTW {
     LOGFONTW elfLogFont;
-    WCHAR[LF_FULLFACESIZE] elfFullName;
-    WCHAR[LF_FACESIZE] elfStyle;
+    WCHAR[LF_FULLFACESIZE] elfFullName = 0;
+    WCHAR[LF_FACESIZE] elfStyle = 0;
 }
 alias ENUMLOGFONTW* LPENUMLOGFONTW;
 
@@ -3728,9 +3728,9 @@ alias ENUMLOGFONTEXA* LPENUMLOGFONTEXA;
 
 struct ENUMLOGFONTEXW {
     LOGFONTW elfLogFont;
-    WCHAR[LF_FULLFACESIZE] elfFullName;
-    WCHAR[LF_FACESIZE] elfStyle;
-    WCHAR[LF_FACESIZE] elfScript;
+    WCHAR[LF_FULLFACESIZE] elfFullName = 0;
+    WCHAR[LF_FACESIZE] elfStyle = 0;
+    WCHAR[LF_FACESIZE] elfScript = 0;
 }
 alias ENUMLOGFONTEXW* LPENUMLOGFONTEXW;
 
@@ -3830,7 +3830,7 @@ enum MM_MAX_AXES_NAMELEN = 16;
     struct AXISINFOW {
         LONG axMinValue;
         LONG axMaxValue;
-        WCHAR[MM_MAX_AXES_NAMELEN] axAxisName;
+        WCHAR[MM_MAX_AXES_NAMELEN] axAxisName = 0;
     }
     alias AXISINFOW* PAXISINFOW, LPAXISINFOW;
 
@@ -3930,21 +3930,21 @@ alias GRADIENT_RECT* PGRADIENT_RECT, LPGRADIENT_RECT;
 
 struct DISPLAY_DEVICEA {
     DWORD cb;
-    CHAR[32] DeviceName;
-    CHAR[128] DeviceString;
+    CHAR[32] DeviceName = 0;
+    CHAR[128] DeviceString = 0;
     DWORD StateFlags;
-    CHAR[128] DeviceID;
-    CHAR[128] DeviceKey;
+    CHAR[128] DeviceID = 0;
+    CHAR[128] DeviceKey = 0;
 }
 alias DISPLAY_DEVICEA* PDISPLAY_DEVICEA, LPDISPLAY_DEVICEA;
 
 struct DISPLAY_DEVICEW {
     DWORD cb;
-    WCHAR[32] DeviceName;
-    WCHAR[128] DeviceString;
+    WCHAR[32] DeviceName = 0;
+    WCHAR[128] DeviceString = 0;
     DWORD StateFlags;
-    WCHAR[128] DeviceID;
-    WCHAR[128] DeviceKey;
+    WCHAR[128] DeviceID = 0;
+    WCHAR[128] DeviceKey = 0;
 }
 alias DISPLAY_DEVICEW* PDISPLAY_DEVICEW, LPDISPLAY_DEVICEW;
 
index 0528f9fbf370470252c9056759a342b89b11dbde..231c31a0e068aeeea513ac31a19079cb2b004455 100644 (file)
@@ -15,7 +15,7 @@ pragma(lib, "wininet");
 
 // FIXME: check types and grouping of constants
 
-import core.sys.windows.windows;
+import core.sys.windows.winbase, core.sys.windows.windef;
 
 enum {
     INTERNET_INVALID_PORT_NUMBER =    0,
@@ -729,22 +729,22 @@ enum INTERNET_INVALID_STATUS_CALLBACK
   = cast(INTERNET_STATUS_CALLBACK) -1;
 
 struct GOPHER_FIND_DATAA {
-    CHAR[MAX_GOPHER_DISPLAY_TEXT+1] DisplayString;
+    CHAR[MAX_GOPHER_DISPLAY_TEXT+1] DisplayString = 0;
     DWORD    GopherType;
     DWORD    SizeLow;
     DWORD    SizeHigh;
     FILETIME LastModificationTime;
-    CHAR[MAX_GOPHER_LOCATOR_LENGTH+1] Locator;
+    CHAR[MAX_GOPHER_LOCATOR_LENGTH+1] Locator = 0;
 }
 alias GOPHER_FIND_DATAA* LPGOPHER_FIND_DATAA;
 
 struct GOPHER_FIND_DATAW {
-    WCHAR[MAX_GOPHER_DISPLAY_TEXT+1] DisplayString;
+    WCHAR[MAX_GOPHER_DISPLAY_TEXT+1] DisplayString = 0;
     DWORD    GopherType;
     DWORD    SizeLow;
     DWORD    SizeHigh;
     FILETIME LastModificationTime;
-    WCHAR[MAX_GOPHER_LOCATOR_LENGTH+1] Locator;
+    WCHAR[MAX_GOPHER_LOCATOR_LENGTH+1] Locator = 0;
 }
 alias GOPHER_FIND_DATAW* LPGOPHER_FIND_DATAW;
 
@@ -953,7 +953,7 @@ struct INTERNET_CACHE_GROUP_INFOA {
     DWORD dwDiskUsage;
     DWORD dwDiskQuota;
     DWORD[GROUP_OWNER_STORAGE_SIZE] dwOwnerStorage;
-    CHAR[GROUPNAME_MAX_LENGTH]      szGroupName;
+    CHAR[GROUPNAME_MAX_LENGTH]      szGroupName = 0;
 }
 alias INTERNET_CACHE_GROUP_INFOA* LPINTERNET_CACHE_GROUP_INFOA;
 
@@ -964,7 +964,7 @@ struct INTERNET_CACHE_GROUP_INFOW {
     DWORD dwDiskUsage;
     DWORD dwDiskQuota;
     DWORD[GROUP_OWNER_STORAGE_SIZE] dwOwnerStorage;
-    WCHAR[GROUPNAME_MAX_LENGTH]     szGroupName;
+    WCHAR[GROUPNAME_MAX_LENGTH]     szGroupName = 0;
 }
 alias INTERNET_CACHE_GROUP_INFOW* LPINTERNET_CACHE_GROUP_INFOW;
 
index a42956209b7c4c642c588c39302145b12fd6886c..cd41a3f70aebd99fdd9dd05b4551310bf561f009 100644 (file)
@@ -563,7 +563,7 @@ struct PARTITION_INFORMATION_GPT {
     GUID      PartitionType;
     GUID      PartitionId;
     DWORD64   Attributes;
-    WCHAR[36] Name;
+    WCHAR[36] Name = 0;
 }
 
 struct PARTITION_INFORMATION_EX {
index 3b7def8843024b8cb04314f4788d7beb64bb4060..1f952b681aabf51602edfd82c857d2009e81804b 100644 (file)
@@ -295,7 +295,7 @@ struct NETINFOSTRUCT {
 }
 alias NETINFOSTRUCT* LPNETINFOSTRUCT;
 
-extern (Pascal) {
+extern (Windows) {
     alias UINT function(LPCSTR, LPSTR, UINT) PFNGETPROFILEPATHA;
     alias UINT function(LPCWSTR, LPWSTR, UINT) PFNGETPROFILEPATHW;
     alias UINT function(LPCSTR, LPCSTR, DWORD) PFNRECONCILEPROFILEA;
index d36d1f3580613d7a9b73958c00949ed208046895..5f1c15005e1dafd156c5dd3ba6b74db50f65cfcc 100644 (file)
@@ -557,9 +557,9 @@ struct CPINFOEXA {
     UINT                  MaxCharSize;
     BYTE[MAX_DEFAULTCHAR] DefaultChar;
     BYTE[MAX_LEADBYTES]   LeadByte;
-    WCHAR                 UnicodeDefaultChar;
+    WCHAR                 UnicodeDefaultChar = 0;
     UINT                  CodePage;
-    CHAR[MAX_PATH]        CodePageName;
+    CHAR[MAX_PATH]        CodePageName = 0;
 }
 alias CPINFOEXA* LPCPINFOEXA;
 
@@ -567,9 +567,9 @@ struct CPINFOEXW {
     UINT                  MaxCharSize;
     BYTE[MAX_DEFAULTCHAR] DefaultChar;
     BYTE[MAX_LEADBYTES]   LeadByte;
-    WCHAR                 UnicodeDefaultChar;
+    WCHAR                 UnicodeDefaultChar = 0;
     UINT                  CodePage;
-    WCHAR[MAX_PATH]       CodePageName;
+    WCHAR[MAX_PATH]       CodePageName = 0;
 }
 alias CPINFOEXW* LPCPINFOEXW;
 
index 596a710bc9feaece891ed854a24ac197d5648317..abb65f87a4d744db3de880dc6b86a3500aa519dc 100644 (file)
@@ -2364,7 +2364,7 @@ struct SID_AND_ATTRIBUTES {
 alias SID_AND_ATTRIBUTES* PSID_AND_ATTRIBUTES;
 
 struct TOKEN_SOURCE {
-    CHAR[TOKEN_SOURCE_LENGTH] SourceName;
+    CHAR[TOKEN_SOURCE_LENGTH] SourceName = 0;
     LUID SourceIdentifier;
 }
 alias TOKEN_SOURCE* PTOKEN_SOURCE;
@@ -2505,8 +2505,8 @@ alias IO_COUNTERS* PIO_COUNTERS;
 struct FILE_NOTIFY_INFORMATION {
     DWORD NextEntryOffset;
     DWORD Action;
-    DWORD FileNameLength;
-    WCHAR _FileName;
+    DWORD FileNameLength = 0;
+    WCHAR _FileName = 0;
 
     WCHAR* FileName() return { return &_FileName; }
 }
@@ -2708,7 +2708,7 @@ struct OSVERSIONINFOA {
     DWORD     dwMinorVersion;
     DWORD     dwBuildNumber;
     DWORD     dwPlatformId;
-    CHAR[128] szCSDVersion;
+    CHAR[128] szCSDVersion = 0;
 }
 alias OSVERSIONINFOA* POSVERSIONINFOA, LPOSVERSIONINFOA;
 
@@ -2718,7 +2718,7 @@ struct OSVERSIONINFOW {
     DWORD      dwMinorVersion;
     DWORD      dwBuildNumber;
     DWORD      dwPlatformId;
-    WCHAR[128] szCSDVersion;
+    WCHAR[128] szCSDVersion = 0;
 }
 alias OSVERSIONINFOW* POSVERSIONINFOW, LPOSVERSIONINFOW;
 
@@ -2728,7 +2728,7 @@ struct OSVERSIONINFOEXA {
     DWORD     dwMinorVersion;
     DWORD     dwBuildNumber;
     DWORD     dwPlatformId;
-    CHAR[128] szCSDVersion;
+    CHAR[128] szCSDVersion = 0;
     WORD      wServicePackMajor;
     WORD      wServicePackMinor;
     WORD      wSuiteMask;
@@ -2743,7 +2743,7 @@ struct OSVERSIONINFOEXW {
     DWORD      dwMinorVersion;
     DWORD      dwBuildNumber;
     DWORD      dwPlatformId;
-    WCHAR[128] szCSDVersion;
+    WCHAR[128] szCSDVersion = 0;
     WORD       wServicePackMajor;
     WORD       wServicePackMinor;
     WORD       wSuiteMask;
@@ -2938,8 +2938,8 @@ alias IMAGE_DOS_HEADER* PIMAGE_DOS_HEADER;
 
 struct IMAGE_OS2_HEADER {
     WORD ne_magic;
-    CHAR ne_ver;
-    CHAR ne_rev;
+    CHAR ne_ver = 0;
+    CHAR ne_rev = 0;
     WORD ne_enttab;
     WORD ne_cbenttab;
     LONG ne_crc;
@@ -3263,7 +3263,7 @@ alias IMAGE_RESOURCE_DIRECTORY_ENTRY* PIMAGE_RESOURCE_DIRECTORY_ENTRY;
 
 struct IMAGE_RESOURCE_DIRECTORY_STRING {
     WORD Length;
-    CHAR _NameString;
+    CHAR _NameString = 0;
 
     CHAR* NameString() return { return &_NameString; }
 }
@@ -3271,7 +3271,7 @@ alias IMAGE_RESOURCE_DIRECTORY_STRING* PIMAGE_RESOURCE_DIRECTORY_STRING;
 
 struct IMAGE_RESOURCE_DIR_STRING_U {
     WORD  Length;
-    WCHAR _NameString;
+    WCHAR _NameString = 0;
 
     WCHAR* NameString() return { return &_NameString; }
 }
@@ -3527,7 +3527,7 @@ struct REPARSE_DATA_BUFFER {
             WORD  PrintNameLength;
             // ??? This is in MinGW, but absent in MSDN docs
             ULONG Flags;
-            WCHAR _PathBuffer;
+            WCHAR _PathBuffer = 0;
 
             WCHAR* PathBuffer() return { return &_PathBuffer; }
         }
@@ -3537,7 +3537,7 @@ struct REPARSE_DATA_BUFFER {
             WORD  SubstituteNameLength;
             WORD  PrintNameOffset;
             WORD  PrintNameLength;
-            WCHAR _PathBuffer;
+            WCHAR _PathBuffer = 0;
 
             WCHAR* PathBuffer() return { return &_PathBuffer; }
         }
index 50b66bbea4bb94666a68a152a546ddf209e17952..24a6c2c3810ddc6a04df8fd0a00fb50c773c87d8 100644 (file)
@@ -82,7 +82,7 @@ enum PERF_RAW_BASE=(PERF_SIZE_DWORD|PERF_TYPE_COUNTER|PERF_COUNTER_BASE|PERF_DIS
 enum PERF_ELAPSED_TIME=(PERF_SIZE_LARGE|PERF_TYPE_COUNTER|PERF_COUNTER_ELAPSED|PERF_OBJECT_TIMER|PERF_DISPLAY_SECONDS);
 
 struct PERF_DATA_BLOCK {
-    WCHAR[4] Signature;
+    WCHAR[4] Signature = 0;
     DWORD LittleEndian;
     DWORD Version;
     DWORD Revision;
index 7928adeadd592953c5d5384d5c0fff8dc53ce603..04e9881d7d96e4110ca4f367e743ce81f521dcf9 100644 (file)
@@ -25,8 +25,8 @@ struct WSADATA
 {
     ushort wVersion;
     ushort wHighVersion;
-    char[WSADESCRIPTION_LEN + 1] szDescription;
-    char[WSASYS_STATUS_LEN + 1] szSystemStatus;
+    char[WSADESCRIPTION_LEN + 1] szDescription = 0;
+    char[WSASYS_STATUS_LEN + 1] szSystemStatus = 0;
     ushort iMaxSockets;
     ushort iMaxUdpDg;
     char* lpVendorInfo;
@@ -643,9 +643,9 @@ alias SOCKADDR* PSOCKADDR, LPSOCKADDR;
 struct sockaddr_storage
 {
     short     ss_family;
-    char[6]   __ss_pad1;
+    char[6]   __ss_pad1 = void;
     long      __ss_align;
-    char[112] __ss_pad2;
+    char[112] __ss_pad2 = void;
 }
 alias sockaddr_storage SOCKADDR_STORAGE;
 alias SOCKADDR_STORAGE* PSOCKADDR_STORAGE;
index 59c0c9fd5df7fa5c5d5726567b7d1472d1d44075..11f0a28c42ff50a5a36ec854402b2650dadd7e81 100644 (file)
@@ -440,6 +440,7 @@ enum WS_EX_MDICHILD = 64;
 enum WS_EX_NOACTIVATE = 0x8000000;  // w2k
 enum WS_EX_NOINHERITLAYOUT = 0x100000;  // w2k
 enum WS_EX_NOPARENTNOTIFY = 4;
+enum WS_EX_NOREDIRECTIONBITMAP = 0x00200000; // w8, s2012
 enum WS_EX_OVERLAPPEDWINDOW = 0x300;
 enum WS_EX_PALETTEWINDOW = 0x188;
 enum WS_EX_RIGHT = 0x1000;
@@ -2865,7 +2866,7 @@ struct MENUITEMTEMPLATEHEADER {
 struct MENUITEMTEMPLATE {
     WORD mtOption;
     WORD mtID;
-    WCHAR[1] mtString;
+    WCHAR[1] mtString = 0;
 }
 
 alias void MENUTEMPLATE, MENUTEMPLATEA, MENUTEMPLATEW;
@@ -3194,15 +3195,15 @@ alias DWORD HELPPOLY;
 
 struct MULTIKEYHELPA {
     DWORD mkSize;
-    CHAR mkKeylist;
-    CHAR[1] szKeyphrase;
+    CHAR mkKeylist = 0;
+    CHAR[1] szKeyphrase = 0;
 }
 alias MULTIKEYHELPA* PMULTIKEYHELPA, LPMULTIKEYHELPA;
 
 struct MULTIKEYHELPW {
     DWORD mkSize;
-    WCHAR mkKeylist;
-    WCHAR[1] szKeyphrase;
+    WCHAR mkKeylist = 0;
+    WCHAR[1] szKeyphrase = 0;
 }
 alias MULTIKEYHELPW* PMULTIKEYHELPW, LPMULTIKEYHELPW;
 
@@ -3213,7 +3214,7 @@ struct HELPWININFOA {
     int dx;
     int dy;
     int wMax;
-    CHAR[2] rgchMember;
+    CHAR[2] rgchMember = 0;
 }
 alias HELPWININFOA* PHELPWININFOA, LPHELPWININFOA;
 
@@ -3224,7 +3225,7 @@ struct HELPWININFOW {
     int dx;
     int dy;
     int wMax;
-    WCHAR[2] rgchMember;
+    WCHAR[2] rgchMember = 0;
 }
 alias HELPWININFOW* PHELPWININFOW, LPHELPWININFOW;
 
@@ -3344,7 +3345,7 @@ struct MONITORINFOEXA {
     RECT  rcMonitor;
     RECT  rcWork;
     DWORD dwFlags;
-    CHAR[CCHDEVICENAME] szDevice;
+    CHAR[CCHDEVICENAME] szDevice = 0;
 }
 alias MONITORINFOEXA* LPMONITORINFOEXA;
 
@@ -3353,7 +3354,7 @@ struct MONITORINFOEXW {
     RECT  rcMonitor;
     RECT  rcWork;
     DWORD dwFlags;
-    WCHAR[CCHDEVICENAME] szDevice;
+    WCHAR[CCHDEVICENAME] szDevice = 0;
 }
 alias MONITORINFOEXW* LPMONITORINFOEXW;
 
index 4dcac9b20d74dd985f794aee24ad3d5cdd514f00..538dc629adb04aaf671598bf754145394ec368c5 100644 (file)
@@ -273,48 +273,48 @@ enum {
 
 static if (_WIN32_WINNT >= 0x600) {
     struct WTSCLIENTW {
-        WCHAR[CLIENTNAME_LENGTH + 1]      ClientName;
-        WCHAR[DOMAIN_LENGTH + 1]          Domain;
-        WCHAR[USERNAME_LENGTH + 1]        UserName;
-        WCHAR[MAX_PATH + 1]               WorkDirectory;
-        WCHAR[MAX_PATH + 1]               InitialProgram;
+        WCHAR[CLIENTNAME_LENGTH + 1]      ClientName = 0;
+        WCHAR[DOMAIN_LENGTH + 1]          Domain = 0;
+        WCHAR[USERNAME_LENGTH + 1]        UserName = 0;
+        WCHAR[MAX_PATH + 1]               WorkDirectory = 0;
+        WCHAR[MAX_PATH + 1]               InitialProgram = 0;
         BYTE                              EncryptionLevel;
         ULONG                             ClientAddressFamily;
         USHORT[CLIENTADDRESS_LENGTH + 1]  ClientAddress;
         USHORT                            HRes;
         USHORT                            VRes;
         USHORT                            ColorDepth;
-        WCHAR[MAX_PATH + 1]               ClientDirectory;
+        WCHAR[MAX_PATH + 1]               ClientDirectory = 0;
         ULONG                             ClientBuildNumber;
         ULONG                             ClientHardwareId;
         USHORT                            ClientProductId;
         USHORT                            OutBufCountHost;
         USHORT                            OutBufCountClient;
         USHORT                            OutBufLength;
-        WCHAR[MAX_PATH + 1]               DeviceId;
+        WCHAR[MAX_PATH + 1]               DeviceId = 0;
     }
     alias WTSCLIENTW* PWTSCLIENTW;
 
     struct WTSCLIENTA {
-        CHAR[CLIENTNAME_LENGTH + 1]       ClientName;
-        CHAR[DOMAIN_LENGTH + 1 ]          Domain;
-        CHAR[USERNAME_LENGTH + 1]         UserName;
-        CHAR[MAX_PATH + 1]                WorkDirectory;
-        CHAR[MAX_PATH + 1]                InitialProgram;
+        CHAR[CLIENTNAME_LENGTH + 1]       ClientName = 0;
+        CHAR[DOMAIN_LENGTH + 1 ]          Domain = 0;
+        CHAR[USERNAME_LENGTH + 1]         UserName = 0;
+        CHAR[MAX_PATH + 1]                WorkDirectory = 0;
+        CHAR[MAX_PATH + 1]                InitialProgram = 0;
         BYTE                              EncryptionLevel;
         ULONG                             ClientAddressFamily;
         USHORT[CLIENTADDRESS_LENGTH + 1]  ClientAddress;
         USHORT                            HRes;
         USHORT                            VRes;
         USHORT                            ColorDepth;
-        CHAR[MAX_PATH + 1]                ClientDirectory;
+        CHAR[MAX_PATH + 1]                ClientDirectory = 0;
         ULONG                             ClientBuildNumber;
         ULONG                             ClientHardwareId;
         USHORT                            ClientProductId;
         USHORT                            OutBufCountHost;
         USHORT                            OutBufCountClient;
         USHORT                            OutBufLength;
-        CHAR[MAX_PATH + 1]                DeviceId;
+        CHAR[MAX_PATH + 1]                DeviceId = 0;
     }
     alias WTSCLIENTA* PWTSCLIENTA;
 
@@ -335,9 +335,9 @@ static if (_WIN32_WINNT >= 0x600) {
         DWORD                        OutgoingFrames;
         DWORD                        IncomingCompressedBytes;
         DWORD                        OutgoingCompressedBytes;
-        WCHAR[WINSTATIONNAME_LENGTH] WinStationName;
-        WCHAR[DOMAIN_LENGTH]         Domain;
-        WCHAR[USERNAME_LENGTH+1]     UserName;
+        WCHAR[WINSTATIONNAME_LENGTH] WinStationName = 0;
+        WCHAR[DOMAIN_LENGTH]         Domain = 0;
+        WCHAR[USERNAME_LENGTH+1]     UserName = 0;
         LARGE_INTEGER                ConnectTime;
         LARGE_INTEGER                DisconnectTime;
         LARGE_INTEGER                LastInputTime;
@@ -355,9 +355,9 @@ static if (_WIN32_WINNT >= 0x600) {
         DWORD                       OutgoingFrames;
         DWORD                       IncomingCompressedBytes;
         DWORD                       OutgoingCompressedBytes;
-        CHAR[WINSTATIONNAME_LENGTH] WinStationName;
-        CHAR[DOMAIN_LENGTH]         Domain;
-        CHAR[USERNAME_LENGTH+1]     UserName;
+        CHAR[WINSTATIONNAME_LENGTH] WinStationName = 0;
+        CHAR[DOMAIN_LENGTH]         Domain = 0;
+        CHAR[USERNAME_LENGTH+1]     UserName = 0;
         LARGE_INTEGER               ConnectTime;
         LARGE_INTEGER               DisconnectTime;
         LARGE_INTEGER               LastInputTime;
index 2d4541bba995a9d3d1e515f6777bd686328adff5..f5aa3d7531e428614cb04b10fdf9ec3c67a28b94 100644 (file)
@@ -191,7 +191,7 @@ unittest
 
 unittest
 {
-    alias RC = common.RC;
+    alias RC = common.RC!();
     Array!RC ary;
 
     size_t cnt;
index 81c2294ee4e24383816b2b993d7e62b772194275..9e6c0138a4f0a292b1b547d2937ee7f24632ad75 100644 (file)
@@ -56,7 +56,7 @@ void initialize(T)(ref T t) if (!is(T == struct))
     t = T.init;
 }
 
-version (unittest) struct RC
+version (unittest) struct RC()
 {
 nothrow:
     this(size_t* cnt) { ++*(_cnt = cnt); }
index 13b88638296af5672d653b18cbea78acc2832b27..fd9f0f7ac8e2841ba5ce5fe54a7ad829b85a47c6 100644 (file)
@@ -290,7 +290,7 @@ unittest
 
 unittest
 {
-    alias RC = common.RC;
+    alias RC = common.RC!();
     HashTab!(size_t, RC) tab;
 
     size_t cnt;