From: Iain Buclaw Date: Tue, 26 Mar 2019 15:18:19 +0000 (+0000) Subject: libphobos: Backport extern(C) bindings from druntime 2.085. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0da83a168fdca32fec2d6bf8280670d05514c4c4;p=gcc.git libphobos: Backport extern(C) bindings from druntime 2.085. Merges upstream druntime b9564bef. Reviewed-on: https://github.com/dlang/druntime/pull/2512 libphobos/ChangeLog: 2019-03-26 Iain Buclaw * 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 --- diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index 13b93352918..1b968177e40 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,11 @@ +2019-03-26 Iain Buclaw + + * 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 * configure.ac: Update autotool version comment. diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE index 1a09ebf5410..ed756fa6c18 100644 --- a/libphobos/libdruntime/MERGE +++ b/libphobos/libdruntime/MERGE @@ -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. diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index 3085bfb181a..53d03b1e82a 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -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 diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 509109b9a71..100312ebf2d 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -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) diff --git a/libphobos/libdruntime/core/stdc/errno.d b/libphobos/libdruntime/core/stdc/errno.d index 03c88d79cb8..06c2b5d94b6 100644 --- a/libphobos/libdruntime/core/stdc/errno.d +++ b/libphobos/libdruntime/core/stdc/errno.d @@ -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) { diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d index d4abc12f502..a1a52141e24 100644 --- a/libphobos/libdruntime/core/stdc/fenv.d +++ b/libphobos/libdruntime/core/stdc/fenv.d @@ -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."); diff --git a/libphobos/libdruntime/core/stdc/stdio.d b/libphobos/libdruntime/core/stdc/stdio.d index c04b9c41228..e708a51763c 100644 --- a/libphobos/libdruntime/core/stdc/stdio.d +++ b/libphobos/libdruntime/core/stdc/stdio.d @@ -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; diff --git a/libphobos/libdruntime/core/stdc/wchar_.d b/libphobos/libdruntime/core/stdc/wchar_.d index 05c3ad862bc..1cf8678f4cc 100644 --- a/libphobos/libdruntime/core/stdc/wchar_.d +++ b/libphobos/libdruntime/core/stdc/wchar_.d @@ -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 diff --git a/libphobos/libdruntime/core/sync/mutex.d b/libphobos/libdruntime/core/sync/mutex.d index 7e57440644a..798f8412a02 100644 --- a/libphobos/libdruntime/core/sync/mutex.d +++ b/libphobos/libdruntime/core/sync/mutex.d @@ -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 index 00000000000..ec0788d7de4 --- /dev/null +++ b/libphobos/libdruntime/core/sys/darwin/crt_externs.d @@ -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(); diff --git a/libphobos/libdruntime/core/sys/darwin/mach/getsect.d b/libphobos/libdruntime/core/sys/darwin/mach/getsect.d index e6dbf5fec65..cf89747d0f2 100644 --- a/libphobos/libdruntime/core/sys/darwin/mach/getsect.d +++ b/libphobos/libdruntime/core/sys/darwin/mach/getsect.d @@ -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 diff --git a/libphobos/libdruntime/core/sys/darwin/mach/loader.d b/libphobos/libdruntime/core/sys/darwin/mach/loader.d index 1254f3ff9cb..0330e55477f 100644 --- a/libphobos/libdruntime/core/sys/darwin/mach/loader.d +++ b/libphobos/libdruntime/core/sys/darwin/mach/loader.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/darwin/netinet/in_.d b/libphobos/libdruntime/core/sys/darwin/netinet/in_.d index 9f1835edcd6..0653d3a4b59 100644 --- a/libphobos/libdruntime/core/sys/darwin/netinet/in_.d +++ b/libphobos/libdruntime/core/sys/darwin/netinet/in_.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d index 92d4a462174..2c35d0b59a3 100644 --- a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d +++ b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d index 38db4cd8e23..94b7e42b5cd 100644 --- a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d +++ b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/freebsd/pthread_np.d b/libphobos/libdruntime/core/sys/freebsd/pthread_np.d index 9e674b6c24d..02b6fda910e 100644 --- a/libphobos/libdruntime/core/sys/freebsd/pthread_np.d +++ b/libphobos/libdruntime/core/sys/freebsd/pthread_np.d @@ -3,7 +3,7 @@ * * Authors: Martin Nowak */ -module core.sys.freebsd.pthread; +module core.sys.freebsd.pthread_np; version (FreeBSD): extern (C) nothrow @nogc: diff --git a/libphobos/libdruntime/core/sys/freebsd/sys/elf32.d b/libphobos/libdruntime/core/sys/freebsd/sys/elf32.d index 4a55a0c001c..61455223b71 100644 --- a/libphobos/libdruntime/core/sys/freebsd/sys/elf32.d +++ b/libphobos/libdruntime/core/sys/freebsd/sys/elf32.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/freebsd/sys/elf64.d b/libphobos/libdruntime/core/sys/freebsd/sys/elf64.d index d3c189ebd60..29c6e3c01b7 100644 --- a/libphobos/libdruntime/core/sys/freebsd/sys/elf64.d +++ b/libphobos/libdruntime/core/sys/freebsd/sys/elf64.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/freebsd/sys/mount.d b/libphobos/libdruntime/core/sys/freebsd/sys/mount.d index ba20b44605d..66c69a4fd81 100644 --- a/libphobos/libdruntime/core/sys/freebsd/sys/mount.d +++ b/libphobos/libdruntime/core/sys/freebsd/sys/mount.d @@ -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 index 00000000000..493cda1c8c9 --- /dev/null +++ b/libphobos/libdruntime/core/sys/freebsd/unistd.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/linux/elf.d b/libphobos/libdruntime/core/sys/linux/elf.d index 45e89eae602..ab07ac94108 100644 --- a/libphobos/libdruntime/core/sys/linux/elf.d +++ b/libphobos/libdruntime/core/sys/linux/elf.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/linux/epoll.d b/libphobos/libdruntime/core/sys/linux/epoll.d index 5b4431a066c..4798967c79d 100644 --- a/libphobos/libdruntime/core/sys/linux/epoll.d +++ b/libphobos/libdruntime/core/sys/linux/epoll.d @@ -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 } diff --git a/libphobos/libdruntime/core/sys/linux/netinet/in_.d b/libphobos/libdruntime/core/sys/linux/netinet/in_.d index 987414ef539..47102e11eb8 100644 --- a/libphobos/libdruntime/core/sys/linux/netinet/in_.d +++ b/libphobos/libdruntime/core/sys/linux/netinet/in_.d @@ -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 diff --git a/libphobos/libdruntime/core/sys/linux/sched.d b/libphobos/libdruntime/core/sys/linux/sched.d index a5f334acd44..b53fa045400 100644 --- a/libphobos/libdruntime/core/sys/linux/sched.d +++ b/libphobos/libdruntime/core/sys/linux/sched.d @@ -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); - diff --git a/libphobos/libdruntime/core/sys/linux/sys/eventfd.d b/libphobos/libdruntime/core/sys/linux/sys/eventfd.d index 7fdd693d815..0954b3f0257 100644 --- a/libphobos/libdruntime/core/sys/linux/sys/eventfd.d +++ b/libphobos/libdruntime/core/sys/linux/sys/eventfd.d @@ -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 diff --git a/libphobos/libdruntime/core/sys/netbsd/sys/elf32.d b/libphobos/libdruntime/core/sys/netbsd/sys/elf32.d index e30addbc03c..b22b97f9f3c 100644 --- a/libphobos/libdruntime/core/sys/netbsd/sys/elf32.d +++ b/libphobos/libdruntime/core/sys/netbsd/sys/elf32.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/netbsd/sys/elf64.d b/libphobos/libdruntime/core/sys/netbsd/sys/elf64.d index c1583f2f890..f78d066ef69 100644 --- a/libphobos/libdruntime/core/sys/netbsd/sys/elf64.d +++ b/libphobos/libdruntime/core/sys/netbsd/sys/elf64.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/posix/aio.d b/libphobos/libdruntime/core/sys/posix/aio.d index be36a03e229..47458160f2e 100644 --- a/libphobos/libdruntime/core/sys/posix/aio.d +++ b/libphobos/libdruntime/core/sys/posix/aio.d @@ -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 diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d index 43e2a475162..61de95802c1 100644 --- a/libphobos/libdruntime/core/sys/posix/config.d +++ b/libphobos/libdruntime/core/sys/posix/config.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/posix/dirent.d b/libphobos/libdruntime/core/sys/posix/dirent.d index 9c5ee30270d..95246fc4471 100644 --- a/libphobos/libdruntime/core/sys/posix/dirent.d +++ b/libphobos/libdruntime/core/sys/posix/dirent.d @@ -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 diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d index 817790ab7eb..4b06600d9fa 100644 --- a/libphobos/libdruntime/core/sys/posix/fcntl.d +++ b/libphobos/libdruntime/core/sys/posix/fcntl.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/posix/setjmp.d b/libphobos/libdruntime/core/sys/posix/setjmp.d index 9028dbc65fc..8b636683e3d 100644 --- a/libphobos/libdruntime/core/sys/posix/setjmp.d +++ b/libphobos/libdruntime/core/sys/posix/setjmp.d @@ -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."); diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d index 68739dd7892..e795a215b4e 100644 --- a/libphobos/libdruntime/core/sys/posix/signal.d +++ b/libphobos/libdruntime/core/sys/posix/signal.d @@ -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 index 00000000000..f5e6c6dbe71 --- /dev/null +++ b/libphobos/libdruntime/core/sys/posix/spawn.d @@ -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"); diff --git a/libphobos/libdruntime/core/sys/posix/sys/ipc.d b/libphobos/libdruntime/core/sys/posix/sys/ipc.d index f9f17e0c6e0..095c81ba41c 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/ipc.d +++ b/libphobos/libdruntime/core/sys/posix/sys/ipc.d @@ -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 diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d index c08ba009f83..c0bee552892 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/mman.d +++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/posix/sys/msg.d b/libphobos/libdruntime/core/sys/posix/sys/msg.d index 1957debbda7..208e5c2dd47 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/msg.d +++ b/libphobos/libdruntime/core/sys/posix/sys/msg.d @@ -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); diff --git a/libphobos/libdruntime/core/sys/posix/sys/resource.d b/libphobos/libdruntime/core/sys/posix/sys/resource.d index dca526563cd..87491fa699b 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/resource.d +++ b/libphobos/libdruntime/core/sys/posix/sys/resource.d @@ -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) { diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d index 6a3f708ed81..d1ebad7318a 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/socket.d +++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d @@ -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 diff --git a/libphobos/libdruntime/core/sys/posix/sys/stat.d b/libphobos/libdruntime/core/sys/posix/sys/stat.d index 8c78ba677a4..53858e713bb 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/stat.d +++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d @@ -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; } diff --git a/libphobos/libdruntime/core/sys/posix/sys/statvfs.d b/libphobos/libdruntime/core/sys/posix/sys/statvfs.d index 4f69b61656d..9828c7b76e7 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/statvfs.d +++ b/libphobos/libdruntime/core/sys/posix/sys/statvfs.d @@ -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 diff --git a/libphobos/libdruntime/core/sys/posix/sys/types.d b/libphobos/libdruntime/core/sys/posix/sys/types.d index 53c78735bb7..060b56f88c8 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/types.d +++ b/libphobos/libdruntime/core/sys/posix/sys/types.d @@ -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 diff --git a/libphobos/libdruntime/core/sys/posix/sys/utsname.d b/libphobos/libdruntime/core/sys/posix/sys/utsname.d index 9d0d5ce7db4..8a5dd0564d4 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/utsname.d +++ b/libphobos/libdruntime/core/sys/posix/sys/utsname.d @@ -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*); diff --git a/libphobos/libdruntime/core/sys/posix/ucontext.d b/libphobos/libdruntime/core/sys/posix/ucontext.d index 0a341e50ada..52b16864917 100644 --- a/libphobos/libdruntime/core/sys/posix/ucontext.d +++ b/libphobos/libdruntime/core/sys/posix/ucontext.d @@ -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; } } diff --git a/libphobos/libdruntime/core/sys/solaris/sys/elf.d b/libphobos/libdruntime/core/sys/solaris/sys/elf.d index c0312fc2b66..7da26317d35 100644 --- a/libphobos/libdruntime/core/sys/solaris/sys/elf.d +++ b/libphobos/libdruntime/core/sys/solaris/sys/elf.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/solaris/sys/priocntl.d b/libphobos/libdruntime/core/sys/solaris/sys/priocntl.d index 81b8bbb7fa1..bfbf3ee2abc 100644 --- a/libphobos/libdruntime/core/sys/solaris/sys/priocntl.d +++ b/libphobos/libdruntime/core/sys/solaris/sys/priocntl.d @@ -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 } diff --git a/libphobos/libdruntime/core/sys/windows/aclapi.d b/libphobos/libdruntime/core/sys/windows/aclapi.d index ed05161bb02..762a4dbed0c 100644 --- a/libphobos/libdruntime/core/sys/windows/aclapi.d +++ b/libphobos/libdruntime/core/sys/windows/aclapi.d @@ -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, diff --git a/libphobos/libdruntime/core/sys/windows/com.d b/libphobos/libdruntime/core/sys/windows/com.d index 15b3d9db079..34aeccc946b 100644 --- a/libphobos/libdruntime/core/sys/windows/com.d +++ b/libphobos/libdruntime/core/sys/windows/com.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/comcat.d b/libphobos/libdruntime/core/sys/windows/comcat.d index 36c6a9125cb..e6ef421a548 100644 --- a/libphobos/libdruntime/core/sys/windows/comcat.d +++ b/libphobos/libdruntime/core/sys/windows/comcat.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/commctrl.d b/libphobos/libdruntime/core/sys/windows/commctrl.d index 9d1dfd88179..bedf36567e1 100644 --- a/libphobos/libdruntime/core/sys/windows/commctrl.d +++ b/libphobos/libdruntime/core/sys/windows/commctrl.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/cpl.d b/libphobos/libdruntime/core/sys/windows/cpl.d index 617e202b47b..823a76bd386 100644 --- a/libphobos/libdruntime/core/sys/windows/cpl.d +++ b/libphobos/libdruntime/core/sys/windows/cpl.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/custcntl.d b/libphobos/libdruntime/core/sys/windows/custcntl.d index 4044ec3153c..3f5284f8854 100644 --- a/libphobos/libdruntime/core/sys/windows/custcntl.d +++ b/libphobos/libdruntime/core/sys/windows/custcntl.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/dbghelp.d b/libphobos/libdruntime/core/sys/windows/dbghelp.d index fddfc633c3e..44c19571437 100644 --- a/libphobos/libdruntime/core/sys/windows/dbghelp.d +++ b/libphobos/libdruntime/core/sys/windows/dbghelp.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/dbghelp_types.d b/libphobos/libdruntime/core/sys/windows/dbghelp_types.d index ff52c565e1d..f75f98bc882 100644 --- a/libphobos/libdruntime/core/sys/windows/dbghelp_types.d +++ b/libphobos/libdruntime/core/sys/windows/dbghelp_types.d @@ -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; } diff --git a/libphobos/libdruntime/core/sys/windows/dbt.d b/libphobos/libdruntime/core/sys/windows/dbt.d index c97944203ec..c43f789a333 100644 --- a/libphobos/libdruntime/core/sys/windows/dbt.d +++ b/libphobos/libdruntime/core/sys/windows/dbt.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/ddeml.d b/libphobos/libdruntime/core/sys/windows/ddeml.d index 4f84a0639eb..a0cce304d95 100644 --- a/libphobos/libdruntime/core/sys/windows/ddeml.d +++ b/libphobos/libdruntime/core/sys/windows/ddeml.d @@ -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; } } diff --git a/libphobos/libdruntime/core/sys/windows/dll.d b/libphobos/libdruntime/core/sys/windows/dll.d index f5ff243594d..3d6a15c834c 100644 --- a/libphobos/libdruntime/core/sys/windows/dll.d +++ b/libphobos/libdruntime/core/sys/windows/dll.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/docobj.d b/libphobos/libdruntime/core/sys/windows/docobj.d index 1ea66db0672..0be79d75558 100644 --- a/libphobos/libdruntime/core/sys/windows/docobj.d +++ b/libphobos/libdruntime/core/sys/windows/docobj.d @@ -73,7 +73,7 @@ struct OLECMDTEXT { DWORD cmdtextf; ULONG cwActual; ULONG cwBuf; - wchar[1] rgwz; + wchar[1] rgwz = 0; } struct OLECMD { diff --git a/libphobos/libdruntime/core/sys/windows/httpext.d b/libphobos/libdruntime/core/sys/windows/httpext.d index 0a3d79c88cf..546523407f2 100644 --- a/libphobos/libdruntime/core/sys/windows/httpext.d +++ b/libphobos/libdruntime/core/sys/windows/httpext.d @@ -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); diff --git a/libphobos/libdruntime/core/sys/windows/imagehlp.d b/libphobos/libdruntime/core/sys/windows/imagehlp.d index 017ecc83980..b77ef761047 100644 --- a/libphobos/libdruntime/core/sys/windows/imagehlp.d +++ b/libphobos/libdruntime/core/sys/windows/imagehlp.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/imm.d b/libphobos/libdruntime/core/sys/windows/imm.d index f6b82df4f79..5a55d04b38a 100644 --- a/libphobos/libdruntime/core/sys/windows/imm.d +++ b/libphobos/libdruntime/core/sys/windows/imm.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/ipexport.d b/libphobos/libdruntime/core/sys/windows/ipexport.d index 6f4853567c5..c9fcbd33a9c 100644 --- a/libphobos/libdruntime/core/sys/windows/ipexport.d +++ b/libphobos/libdruntime/core/sys/windows/ipexport.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/iprtrmib.d b/libphobos/libdruntime/core/sys/windows/iprtrmib.d index d4f622dba83..4365723a50e 100644 --- a/libphobos/libdruntime/core/sys/windows/iprtrmib.d +++ b/libphobos/libdruntime/core/sys/windows/iprtrmib.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/iptypes.d b/libphobos/libdruntime/core/sys/windows/iptypes.d index 296735d2030..ada3e9cca58 100644 --- a/libphobos/libdruntime/core/sys/windows/iptypes.d +++ b/libphobos/libdruntime/core/sys/windows/iptypes.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/lmalert.d b/libphobos/libdruntime/core/sys/windows/lmalert.d index babc16ad9a5..53acff035b5 100644 --- a/libphobos/libdruntime/core/sys/windows/lmalert.d +++ b/libphobos/libdruntime/core/sys/windows/lmalert.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/mapi.d b/libphobos/libdruntime/core/sys/windows/mapi.d index ab85952a4b0..2f8f03b8ab0 100644 --- a/libphobos/libdruntime/core/sys/windows/mapi.d +++ b/libphobos/libdruntime/core/sys/windows/mapi.d @@ -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); diff --git a/libphobos/libdruntime/core/sys/windows/mmsystem.d b/libphobos/libdruntime/core/sys/windows/mmsystem.d index d519e114de4..ceb4c3d513a 100644 --- a/libphobos/libdruntime/core/sys/windows/mmsystem.d +++ b/libphobos/libdruntime/core/sys/windows/mmsystem.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/msacm.d b/libphobos/libdruntime/core/sys/windows/msacm.d index 04f6157df82..c6bf8af248e 100644 --- a/libphobos/libdruntime/core/sys/windows/msacm.d +++ b/libphobos/libdruntime/core/sys/windows/msacm.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/objidl.d b/libphobos/libdruntime/core/sys/windows/objidl.d index d96b6e4996e..7b3367705b1 100644 --- a/libphobos/libdruntime/core/sys/windows/objidl.d +++ b/libphobos/libdruntime/core/sys/windows/objidl.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/oledlg.d b/libphobos/libdruntime/core/sys/windows/oledlg.d index 71b5dcd7c09..732d302ac02 100644 --- a/libphobos/libdruntime/core/sys/windows/oledlg.d +++ b/libphobos/libdruntime/core/sys/windows/oledlg.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/ras.d b/libphobos/libdruntime/core/sys/windows/ras.d index f480c2bc91e..479aa3ba0bf 100644 --- a/libphobos/libdruntime/core/sys/windows/ras.d +++ b/libphobos/libdruntime/core/sys/windows/ras.d @@ -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; } diff --git a/libphobos/libdruntime/core/sys/windows/rasdlg.d b/libphobos/libdruntime/core/sys/windows/rasdlg.d index 5295b620204..77346cb3318 100644 --- a/libphobos/libdruntime/core/sys/windows/rasdlg.d +++ b/libphobos/libdruntime/core/sys/windows/rasdlg.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/rassapi.d b/libphobos/libdruntime/core/sys/windows/rassapi.d index 11d5bb4ad92..b70dc07d146 100644 --- a/libphobos/libdruntime/core/sys/windows/rassapi.d +++ b/libphobos/libdruntime/core/sys/windows/rassapi.d @@ -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 { diff --git a/libphobos/libdruntime/core/sys/windows/richedit.d b/libphobos/libdruntime/core/sys/windows/richedit.d index edeb552175b..a05c3b8deaf 100644 --- a/libphobos/libdruntime/core/sys/windows/richedit.d +++ b/libphobos/libdruntime/core/sys/windows/richedit.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/setupapi.d b/libphobos/libdruntime/core/sys/windows/setupapi.d index 65fb5544422..8df96b16353 100644 --- a/libphobos/libdruntime/core/sys/windows/setupapi.d +++ b/libphobos/libdruntime/core/sys/windows/setupapi.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/shellapi.d b/libphobos/libdruntime/core/sys/windows/shellapi.d index ba78cc4e721..26c6f78c404 100644 --- a/libphobos/libdruntime/core/sys/windows/shellapi.d +++ b/libphobos/libdruntime/core/sys/windows/shellapi.d @@ -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 { diff --git a/libphobos/libdruntime/core/sys/windows/shlobj.d b/libphobos/libdruntime/core/sys/windows/shlobj.d index 0745b706e84..ff7f8985c35 100644 --- a/libphobos/libdruntime/core/sys/windows/shlobj.d +++ b/libphobos/libdruntime/core/sys/windows/shlobj.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/snmp.d b/libphobos/libdruntime/core/sys/windows/snmp.d index 09901507f9e..4f550184d0a 100644 --- a/libphobos/libdruntime/core/sys/windows/snmp.d +++ b/libphobos/libdruntime/core/sys/windows/snmp.d @@ -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 { diff --git a/libphobos/libdruntime/core/sys/windows/stacktrace.d b/libphobos/libdruntime/core/sys/windows/stacktrace.d index 13f33edc3e0..d354ffecfe3 100644 --- a/libphobos/libdruntime/core/sys/windows/stacktrace.d +++ b/libphobos/libdruntime/core/sys/windows/stacktrace.d @@ -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 ) diff --git a/libphobos/libdruntime/core/sys/windows/subauth.d b/libphobos/libdruntime/core/sys/windows/subauth.d index 39e8beb6c2b..9d39a90619a 100644 --- a/libphobos/libdruntime/core/sys/windows/subauth.d +++ b/libphobos/libdruntime/core/sys/windows/subauth.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/threadaux.d b/libphobos/libdruntime/core/sys/windows/threadaux.d index 491a02b7444..4e887b7be4e 100644 --- a/libphobos/libdruntime/core/sys/windows/threadaux.d +++ b/libphobos/libdruntime/core/sys/windows/threadaux.d @@ -15,7 +15,10 @@ 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; diff --git a/libphobos/libdruntime/core/sys/windows/tlhelp32.d b/libphobos/libdruntime/core/sys/windows/tlhelp32.d index db571e075e8..3a3959f8deb 100644 --- a/libphobos/libdruntime/core/sys/windows/tlhelp32.d +++ b/libphobos/libdruntime/core/sys/windows/tlhelp32.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/vfw.d b/libphobos/libdruntime/core/sys/windows/vfw.d index d45f1c3dd62..4d168b38a86 100644 --- a/libphobos/libdruntime/core/sys/windows/vfw.d +++ b/libphobos/libdruntime/core/sys/windows/vfw.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/winbase.d b/libphobos/libdruntime/core/sys/windows/winbase.d index 753f511542b..280c4684b33 100644 --- a/libphobos/libdruntime/core/sys/windows/winbase.d +++ b/libphobos/libdruntime/core/sys/windows/winbase.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/wincon.d b/libphobos/libdruntime/core/sys/windows/wincon.d index 08061f4ecab..6b06c14b166 100644 --- a/libphobos/libdruntime/core/sys/windows/wincon.d +++ b/libphobos/libdruntime/core/sys/windows/wincon.d @@ -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; } diff --git a/libphobos/libdruntime/core/sys/windows/wincrypt.d b/libphobos/libdruntime/core/sys/windows/wincrypt.d index e1f58b97e07..0651ea803cf 100644 --- a/libphobos/libdruntime/core/sys/windows/wincrypt.d +++ b/libphobos/libdruntime/core/sys/windows/wincrypt.d @@ -795,7 +795,7 @@ struct PROV_ENUMALGS { ALG_ID aiAlgid; DWORD dwBitLen; DWORD dwNameLen; - CHAR[20] szName; + CHAR[20] szName = 0; } struct PUBLICKEYSTRUC { diff --git a/libphobos/libdruntime/core/sys/windows/wingdi.d b/libphobos/libdruntime/core/sys/windows/wingdi.d index 55b10f97bba..e495b2be84f 100644 --- a/libphobos/libdruntime/core/sys/windows/wingdi.d +++ b/libphobos/libdruntime/core/sys/windows/wingdi.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/wininet.d b/libphobos/libdruntime/core/sys/windows/wininet.d index 0528f9fbf37..231c31a0e06 100644 --- a/libphobos/libdruntime/core/sys/windows/wininet.d +++ b/libphobos/libdruntime/core/sys/windows/wininet.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/winioctl.d b/libphobos/libdruntime/core/sys/windows/winioctl.d index a42956209b7..cd41a3f70ae 100644 --- a/libphobos/libdruntime/core/sys/windows/winioctl.d +++ b/libphobos/libdruntime/core/sys/windows/winioctl.d @@ -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 { diff --git a/libphobos/libdruntime/core/sys/windows/winnetwk.d b/libphobos/libdruntime/core/sys/windows/winnetwk.d index 3b7def88430..1f952b681aa 100644 --- a/libphobos/libdruntime/core/sys/windows/winnetwk.d +++ b/libphobos/libdruntime/core/sys/windows/winnetwk.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/winnls.d b/libphobos/libdruntime/core/sys/windows/winnls.d index d36d1f35806..5f1c15005e1 100644 --- a/libphobos/libdruntime/core/sys/windows/winnls.d +++ b/libphobos/libdruntime/core/sys/windows/winnls.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/winnt.d b/libphobos/libdruntime/core/sys/windows/winnt.d index 596a710bc9f..abb65f87a4d 100644 --- a/libphobos/libdruntime/core/sys/windows/winnt.d +++ b/libphobos/libdruntime/core/sys/windows/winnt.d @@ -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; } } diff --git a/libphobos/libdruntime/core/sys/windows/winperf.d b/libphobos/libdruntime/core/sys/windows/winperf.d index 50b66bbea4b..24a6c2c3810 100644 --- a/libphobos/libdruntime/core/sys/windows/winperf.d +++ b/libphobos/libdruntime/core/sys/windows/winperf.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/winsock2.d b/libphobos/libdruntime/core/sys/windows/winsock2.d index 7928adeadd5..04e9881d7d9 100644 --- a/libphobos/libdruntime/core/sys/windows/winsock2.d +++ b/libphobos/libdruntime/core/sys/windows/winsock2.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/winuser.d b/libphobos/libdruntime/core/sys/windows/winuser.d index 59c0c9fd5df..11f0a28c42f 100644 --- a/libphobos/libdruntime/core/sys/windows/winuser.d +++ b/libphobos/libdruntime/core/sys/windows/winuser.d @@ -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; diff --git a/libphobos/libdruntime/core/sys/windows/wtsapi32.d b/libphobos/libdruntime/core/sys/windows/wtsapi32.d index 4dcac9b20d7..538dc629adb 100644 --- a/libphobos/libdruntime/core/sys/windows/wtsapi32.d +++ b/libphobos/libdruntime/core/sys/windows/wtsapi32.d @@ -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; diff --git a/libphobos/libdruntime/rt/util/container/array.d b/libphobos/libdruntime/rt/util/container/array.d index 2d4541bba99..f5aa3d7531e 100644 --- a/libphobos/libdruntime/rt/util/container/array.d +++ b/libphobos/libdruntime/rt/util/container/array.d @@ -191,7 +191,7 @@ unittest unittest { - alias RC = common.RC; + alias RC = common.RC!(); Array!RC ary; size_t cnt; diff --git a/libphobos/libdruntime/rt/util/container/common.d b/libphobos/libdruntime/rt/util/container/common.d index 81c2294ee4e..9e6c0138a4f 100644 --- a/libphobos/libdruntime/rt/util/container/common.d +++ b/libphobos/libdruntime/rt/util/container/common.d @@ -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); } diff --git a/libphobos/libdruntime/rt/util/container/hashtab.d b/libphobos/libdruntime/rt/util/container/hashtab.d index 13b88638296..fd9f0f7ac8e 100644 --- a/libphobos/libdruntime/rt/util/container/hashtab.d +++ b/libphobos/libdruntime/rt/util/container/hashtab.d @@ -290,7 +290,7 @@ unittest unittest { - alias RC = common.RC; + alias RC = common.RC!(); HashTab!(size_t, RC) tab; size_t cnt;