aboutsummaryrefslogtreecommitdiff
path: root/libphobos/libdruntime
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-03-29 09:01:23 -0700
committerIan Lance Taylor <iant@golang.org>2023-03-29 09:01:23 -0700
commit6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced (patch)
tree1deecdcfbf185c7044bc861d0ace51285c96cb62 /libphobos/libdruntime
parent795cffe109e28b248a54b8ee583cbae48368c2a7 (diff)
parentaa8f4242efc99f24de73c59d53996f28db28c13f (diff)
downloadgcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.zip
gcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.tar.gz
gcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.tar.bz2
Merge from trunk revision aa8f4242efc99f24de73c59d53996f28db28c13f.
Diffstat (limited to 'libphobos/libdruntime')
-rw-r--r--libphobos/libdruntime/MERGE2
-rw-r--r--libphobos/libdruntime/Makefile.am14
-rw-r--r--libphobos/libdruntime/Makefile.in33
-rw-r--r--libphobos/libdruntime/__builtins.di2
-rw-r--r--libphobos/libdruntime/__main.di2
-rw-r--r--libphobos/libdruntime/config/aarch64/switchcontext.S2
-rw-r--r--libphobos/libdruntime/config/arm/switchcontext.S2
-rw-r--r--libphobos/libdruntime/config/common/threadasm.S2
-rw-r--r--libphobos/libdruntime/config/mingw/msvc.c2
-rw-r--r--libphobos/libdruntime/config/mingw/switchcontext.S2
-rw-r--r--libphobos/libdruntime/config/mips/switchcontext.S2
-rw-r--r--libphobos/libdruntime/config/powerpc/switchcontext.S2
-rw-r--r--libphobos/libdruntime/config/s390/get_tls_offset.S2
-rw-r--r--libphobos/libdruntime/config/systemz/get_tls_offset.S2
-rw-r--r--libphobos/libdruntime/config/x86/switchcontext.S2
-rw-r--r--libphobos/libdruntime/core/attribute.d4
-rw-r--r--libphobos/libdruntime/core/cpuid.d2
-rw-r--r--libphobos/libdruntime/core/demangle.d394
-rw-r--r--libphobos/libdruntime/core/exception.d26
-rw-r--r--libphobos/libdruntime/core/factory.d68
-rw-r--r--libphobos/libdruntime/core/int128.d19
-rw-r--r--libphobos/libdruntime/core/internal/array/appending.d51
-rw-r--r--libphobos/libdruntime/core/internal/array/arrayassign.d148
-rw-r--r--libphobos/libdruntime/core/internal/array/capacity.d23
-rw-r--r--libphobos/libdruntime/core/internal/array/concatenation.d23
-rw-r--r--libphobos/libdruntime/core/internal/array/duplication.d58
-rw-r--r--libphobos/libdruntime/core/internal/array/utils.d135
-rw-r--r--libphobos/libdruntime/core/internal/dassert.d2
-rw-r--r--libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d14
-rw-r--r--libphobos/libdruntime/core/internal/gc/impl/manual/gc.d7
-rw-r--r--libphobos/libdruntime/core/internal/gc/os.d3
-rw-r--r--libphobos/libdruntime/core/internal/traits.d2
-rw-r--r--libphobos/libdruntime/core/internal/utf.d21
-rw-r--r--libphobos/libdruntime/core/lifetime.d134
-rw-r--r--libphobos/libdruntime/core/memory.d4
-rw-r--r--libphobos/libdruntime/core/runtime.d91
-rw-r--r--libphobos/libdruntime/core/simd.d2
-rw-r--r--libphobos/libdruntime/core/stdc/config.d41
-rw-r--r--libphobos/libdruntime/core/stdc/fenv.d3
-rw-r--r--libphobos/libdruntime/core/stdc/math.d11
-rw-r--r--libphobos/libdruntime/core/stdc/signal.d1
-rw-r--r--libphobos/libdruntime/core/stdc/stdarg.d1
-rw-r--r--libphobos/libdruntime/core/stdc/stdio.d1
-rw-r--r--libphobos/libdruntime/core/stdc/stdlib.d1
-rw-r--r--libphobos/libdruntime/core/stdc/string.d1
-rw-r--r--libphobos/libdruntime/core/stdc/time.d6
-rw-r--r--libphobos/libdruntime/core/stdc/wchar_.d1
-rw-r--r--libphobos/libdruntime/core/sync/condition.d35
-rw-r--r--libphobos/libdruntime/core/sync/mutex.d2
-rw-r--r--libphobos/libdruntime/core/sys/darwin/fcntl.d1
-rw-r--r--libphobos/libdruntime/core/sys/darwin/ifaddrs.d1
-rw-r--r--libphobos/libdruntime/core/sys/darwin/mach/getsect.d2
-rw-r--r--libphobos/libdruntime/core/sys/darwin/mach/loader.d2
-rw-r--r--libphobos/libdruntime/core/sys/darwin/sys/event.d4
-rw-r--r--libphobos/libdruntime/core/sys/elf/package.d1
-rw-r--r--libphobos/libdruntime/core/sys/freebsd/config.d5
-rw-r--r--libphobos/libdruntime/core/sys/linux/dlfcn.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/elf.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/epoll.d2
-rw-r--r--libphobos/libdruntime/core/sys/linux/err.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/errno.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/execinfo.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/fcntl.d3
-rw-r--r--libphobos/libdruntime/core/sys/linux/fs.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/ifaddrs.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/io_uring.d2
-rw-r--r--libphobos/libdruntime/core/sys/linux/link.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/perf_event.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/sched.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/stdio.d3
-rw-r--r--libphobos/libdruntime/core/sys/linux/string.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/sys/eventfd.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/sys/inotify.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/sys/mman.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/sys/prctl.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/sys/signalfd.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/sys/sysinfo.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/sys/xattr.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/timerfd.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/tipc.d1
-rw-r--r--libphobos/libdruntime/core/sys/linux/unistd.d1
-rw-r--r--libphobos/libdruntime/core/sys/openbsd/sys/mman.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/aio.d3
-rw-r--r--libphobos/libdruntime/core/sys/posix/config.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/dirent.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/dlfcn.d37
-rw-r--r--libphobos/libdruntime/core/sys/posix/fcntl.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/grp.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/iconv.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/inttypes.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/libgen.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/locale.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/mqueue.d7
-rw-r--r--libphobos/libdruntime/core/sys/posix/netdb.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/netinet/in_.d48
-rw-r--r--libphobos/libdruntime/core/sys/posix/poll.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/pthread.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/pwd.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sched.d7
-rw-r--r--libphobos/libdruntime/core/sys/posix/semaphore.d2
-rw-r--r--libphobos/libdruntime/core/sys/posix/setjmp.d17
-rw-r--r--libphobos/libdruntime/core/sys/posix/signal.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/spawn.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/stdio.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/stdlib.d21
-rw-r--r--libphobos/libdruntime/core/sys/posix/string.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/strings.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/filio.d1
-rwxr-xr-xlibphobos/libdruntime/core/sys/posix/sys/ioccom.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/ioctl.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/ipc.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/mman.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/msg.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/resource.d2
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/select.d3
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/shm.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/socket.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/stat.d5
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/statvfs.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/time.d3
-rwxr-xr-xlibphobos/libdruntime/core/sys/posix/sys/ttycom.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/types.d13
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/uio.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/un.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/utsname.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/wait.d14
-rw-r--r--libphobos/libdruntime/core/sys/posix/syslog.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/termios.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/time.d11
-rw-r--r--libphobos/libdruntime/core/sys/posix/ucontext.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/unistd.d1
-rw-r--r--libphobos/libdruntime/core/sys/posix/utime.d2
-rw-r--r--libphobos/libdruntime/core/sys/windows/aclapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/aclui.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/basetsd.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/basetyps.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/com.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/comcat.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/commctrl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/commdlg.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/cpl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/cplext.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/custcntl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/dbghelp.d5
-rw-r--r--libphobos/libdruntime/core/sys/windows/dbghelp_types.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/dbt.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/dde.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ddeml.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/dhcpcsdk.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/dlgs.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/dll.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/docobj.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/errorrep.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/exdisp.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/httpext.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/imagehlp.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/imm.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/intshcut.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ipexport.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/iphlpapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/iprtrmib.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/iptypes.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lm.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmaccess.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmalert.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmat.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmaudit.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmbrowsr.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmchdev.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmconfig.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmcons.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmerr.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmerrlog.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmmsg.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmremutl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmrepl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmserver.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmshare.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmsname.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmstats.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmsvc.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmuse.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lmwksta.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/lzexpand.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/mapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/mciavi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/mcx.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/mgmtapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/mmsystem.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/msacm.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/mshtml.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/mswsock.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/nb30.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/nddeapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/nspapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ntdef.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ntdll.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ntldap.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ntsecapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ntsecpkg.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/oaidl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/objbase.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/objfwd.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/objidl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/objsafe.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ocidl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/odbcinst.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ole.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ole2.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/oleacc.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/oleauto.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/olectl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/oledlg.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/oleidl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/pbt.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/powrprof.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/prsht.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/psapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/ras.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rasdlg.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/raserror.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rassapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/reason.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/regstr.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/richedit.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/richole.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rpc.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rpcdce.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rpcdce2.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rpcdcep.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rpcndr.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rpcnsi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rpcnsip.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/rpcnterr.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/schannel.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/sdkddkver.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/secext.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/security.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/servprov.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/setupapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/shellapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/shldisp.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/shlguid.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/shlobj.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/shlwapi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/snmp.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/sql.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/sqlext.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/sqltypes.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/sqlucode.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/sspi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/stacktrace.d91
-rw-r--r--libphobos/libdruntime/core/sys/windows/stat.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/stdc/malloc.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/subauth.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/threadaux.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/tlhelp32.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/tmschema.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/unknwn.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/uuid.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/vfw.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/w32api.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winbase.d26
-rw-r--r--libphobos/libdruntime/core/sys/windows/winber.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/wincon.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/wincrypt.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/windef.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/windows.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winerror.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/wingdi.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winhttp.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/wininet.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winioctl.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winldap.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winnetwk.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winnls.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winnt.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winperf.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winreg.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winsock2.d5
-rw-r--r--libphobos/libdruntime/core/sys/windows/winspool.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winsvc.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winuser.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/winver.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/wtsapi32.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/wtypes.d1
-rw-r--r--libphobos/libdruntime/core/thread/fiber.d18
-rw-r--r--libphobos/libdruntime/core/thread/osthread.d20
-rw-r--r--libphobos/libdruntime/core/thread/types.d18
-rw-r--r--libphobos/libdruntime/core/time.d4
-rw-r--r--libphobos/libdruntime/gcc/attribute.d2
-rw-r--r--libphobos/libdruntime/gcc/attributes.d2
-rw-r--r--libphobos/libdruntime/gcc/backtrace.d14
-rw-r--r--libphobos/libdruntime/gcc/builtins.d2
-rw-r--r--libphobos/libdruntime/gcc/config.d.in2
-rw-r--r--libphobos/libdruntime/gcc/deh.d2
-rw-r--r--libphobos/libdruntime/gcc/drtstuff.c2
-rw-r--r--libphobos/libdruntime/gcc/emutls.d2
-rw-r--r--libphobos/libdruntime/gcc/gthread.d2
-rw-r--r--libphobos/libdruntime/gcc/libbacktrace.d.in14
-rw-r--r--libphobos/libdruntime/gcc/sections/common.d2
-rw-r--r--libphobos/libdruntime/gcc/sections/elf.d2
-rw-r--r--libphobos/libdruntime/gcc/sections/macho.d2
-rw-r--r--libphobos/libdruntime/gcc/sections/package.d2
-rw-r--r--libphobos/libdruntime/gcc/sections/pecoff.d2
-rw-r--r--libphobos/libdruntime/gcc/simd.d28
-rw-r--r--libphobos/libdruntime/gcc/unwind/arm.d2
-rw-r--r--libphobos/libdruntime/gcc/unwind/arm_common.d2
-rw-r--r--libphobos/libdruntime/gcc/unwind/c6x.d2
-rw-r--r--libphobos/libdruntime/gcc/unwind/generic.d2
-rw-r--r--libphobos/libdruntime/gcc/unwind/package.d2
-rw-r--r--libphobos/libdruntime/gcc/unwind/pe.d2
-rw-r--r--libphobos/libdruntime/object.d121
-rw-r--r--libphobos/libdruntime/rt/arrayassign.d60
-rw-r--r--libphobos/libdruntime/rt/deh.d2
-rw-r--r--libphobos/libdruntime/rt/dmain2.d12
-rw-r--r--libphobos/libdruntime/rt/lifetime.d60
318 files changed, 1365 insertions, 1007 deletions
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index 85fc49d..986925e 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-817610b16d0f0f469b9fbb28c000956fb910c43f
+5f7552bb2829b75d5e36cc767a476e1ab35147b7
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am
index d828749..8225ba4 100644
--- a/libphobos/libdruntime/Makefile.am
+++ b/libphobos/libdruntime/Makefile.am
@@ -1,5 +1,5 @@
# Makefile for the D runtime library.
-# Copyright (C) 2012-2022 Free Software Foundation, Inc.
+# Copyright (C) 2012-2023 Free Software Foundation, Inc.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -169,7 +169,7 @@ DRUNTIME_CSOURCES = core/stdc/errno_.c
DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \
core/builtins.d core/checkedint.d core/cpuid.d core/demangle.d \
- core/exception.d core/gc/config.d core/gc/gcinterface.d \
+ core/exception.d core/factory.d core/gc/config.d core/gc/gcinterface.d \
core/gc/registry.d core/int128.d core/internal/abort.d \
core/internal/array/appending.d core/internal/array/arrayassign.d \
core/internal/array/capacity.d core/internal/array/casting.d \
@@ -211,11 +211,11 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \
gcc/sections/package.d gcc/sections/pecoff.d gcc/simd.d \
gcc/unwind/arm.d gcc/unwind/arm_common.d gcc/unwind/c6x.d \
gcc/unwind/generic.d gcc/unwind/package.d gcc/unwind/pe.d object.d \
- rt/aApply.d rt/aApplyR.d rt/aaA.d rt/adi.d rt/arrayassign.d \
- rt/arraycat.d rt/cast_.d rt/config.d rt/critical_.d rt/deh.d \
- rt/dmain2.d rt/ehalloc.d rt/invariant.d rt/lifetime.d rt/memory.d \
- rt/minfo.d rt/monitor_.d rt/profilegc.d rt/sections.d rt/tlsgc.d \
- rt/util/typeinfo.d rt/util/utility.d
+ rt/aApply.d rt/aApplyR.d rt/aaA.d rt/adi.d rt/arraycat.d rt/cast_.d \
+ rt/config.d rt/critical_.d rt/deh.d rt/dmain2.d rt/ehalloc.d \
+ rt/invariant.d rt/lifetime.d rt/memory.d rt/minfo.d rt/monitor_.d \
+ rt/profilegc.d rt/sections.d rt/tlsgc.d rt/util/typeinfo.d \
+ rt/util/utility.d
DRUNTIME_DSOURCES_STDCXX = core/stdcpp/allocator.d core/stdcpp/array.d \
core/stdcpp/exception.d core/stdcpp/memory.d core/stdcpp/new_.d \
diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in
index 57660ee..797d643 100644
--- a/libphobos/libdruntime/Makefile.in
+++ b/libphobos/libdruntime/Makefile.in
@@ -15,7 +15,7 @@
@SET_MAKE@
# Makefile for the D runtime library.
-# Copyright (C) 2012-2022 Free Software Foundation, Inc.
+# Copyright (C) 2012-2023 Free Software Foundation, Inc.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -189,9 +189,10 @@ am__DEPENDENCIES_1 =
am__dirstamp = $(am__leading_dot)dirstamp
am__objects_1 = core/atomic.lo core/attribute.lo core/bitop.lo \
core/builtins.lo core/checkedint.lo core/cpuid.lo \
- core/demangle.lo core/exception.lo core/gc/config.lo \
- core/gc/gcinterface.lo core/gc/registry.lo core/int128.lo \
- core/internal/abort.lo core/internal/array/appending.lo \
+ core/demangle.lo core/exception.lo core/factory.lo \
+ core/gc/config.lo core/gc/gcinterface.lo core/gc/registry.lo \
+ core/int128.lo core/internal/abort.lo \
+ core/internal/array/appending.lo \
core/internal/array/arrayassign.lo \
core/internal/array/capacity.lo core/internal/array/casting.lo \
core/internal/array/comparison.lo \
@@ -242,11 +243,11 @@ am__objects_1 = core/atomic.lo core/attribute.lo core/bitop.lo \
gcc/unwind/arm_common.lo gcc/unwind/c6x.lo \
gcc/unwind/generic.lo gcc/unwind/package.lo gcc/unwind/pe.lo \
object.lo rt/aApply.lo rt/aApplyR.lo rt/aaA.lo rt/adi.lo \
- rt/arrayassign.lo rt/arraycat.lo rt/cast_.lo rt/config.lo \
- rt/critical_.lo rt/deh.lo rt/dmain2.lo rt/ehalloc.lo \
- rt/invariant.lo rt/lifetime.lo rt/memory.lo rt/minfo.lo \
- rt/monitor_.lo rt/profilegc.lo rt/sections.lo rt/tlsgc.lo \
- rt/util/typeinfo.lo rt/util/utility.lo
+ rt/arraycat.lo rt/cast_.lo rt/config.lo rt/critical_.lo \
+ rt/deh.lo rt/dmain2.lo rt/ehalloc.lo rt/invariant.lo \
+ rt/lifetime.lo rt/memory.lo rt/minfo.lo rt/monitor_.lo \
+ rt/profilegc.lo rt/sections.lo rt/tlsgc.lo rt/util/typeinfo.lo \
+ rt/util/utility.lo
am__objects_2 = core/stdc/libgdruntime_la-errno_.lo
am__objects_3 = core/sys/elf/package.lo
am__objects_4 = core/stdcpp/allocator.lo core/stdcpp/array.lo \
@@ -838,7 +839,7 @@ libgdruntime_convenience_la_LINK = $(libgdruntime_la_LINK)
DRUNTIME_CSOURCES = core/stdc/errno_.c
DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \
core/builtins.d core/checkedint.d core/cpuid.d core/demangle.d \
- core/exception.d core/gc/config.d core/gc/gcinterface.d \
+ core/exception.d core/factory.d core/gc/config.d core/gc/gcinterface.d \
core/gc/registry.d core/int128.d core/internal/abort.d \
core/internal/array/appending.d core/internal/array/arrayassign.d \
core/internal/array/capacity.d core/internal/array/casting.d \
@@ -880,11 +881,11 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \
gcc/sections/package.d gcc/sections/pecoff.d gcc/simd.d \
gcc/unwind/arm.d gcc/unwind/arm_common.d gcc/unwind/c6x.d \
gcc/unwind/generic.d gcc/unwind/package.d gcc/unwind/pe.d object.d \
- rt/aApply.d rt/aApplyR.d rt/aaA.d rt/adi.d rt/arrayassign.d \
- rt/arraycat.d rt/cast_.d rt/config.d rt/critical_.d rt/deh.d \
- rt/dmain2.d rt/ehalloc.d rt/invariant.d rt/lifetime.d rt/memory.d \
- rt/minfo.d rt/monitor_.d rt/profilegc.d rt/sections.d rt/tlsgc.d \
- rt/util/typeinfo.d rt/util/utility.d
+ rt/aApply.d rt/aApplyR.d rt/aaA.d rt/adi.d rt/arraycat.d rt/cast_.d \
+ rt/config.d rt/critical_.d rt/deh.d rt/dmain2.d rt/ehalloc.d \
+ rt/invariant.d rt/lifetime.d rt/memory.d rt/minfo.d rt/monitor_.d \
+ rt/profilegc.d rt/sections.d rt/tlsgc.d rt/util/typeinfo.d \
+ rt/util/utility.d
DRUNTIME_DSOURCES_STDCXX = core/stdcpp/allocator.d core/stdcpp/array.d \
core/stdcpp/exception.d core/stdcpp/memory.d core/stdcpp/new_.d \
@@ -1188,6 +1189,7 @@ core/checkedint.lo: core/$(am__dirstamp)
core/cpuid.lo: core/$(am__dirstamp)
core/demangle.lo: core/$(am__dirstamp)
core/exception.lo: core/$(am__dirstamp)
+core/factory.lo: core/$(am__dirstamp)
core/gc/$(am__dirstamp):
@$(MKDIR_P) core/gc
@: > core/gc/$(am__dirstamp)
@@ -1364,7 +1366,6 @@ rt/aApply.lo: rt/$(am__dirstamp)
rt/aApplyR.lo: rt/$(am__dirstamp)
rt/aaA.lo: rt/$(am__dirstamp)
rt/adi.lo: rt/$(am__dirstamp)
-rt/arrayassign.lo: rt/$(am__dirstamp)
rt/arraycat.lo: rt/$(am__dirstamp)
rt/cast_.lo: rt/$(am__dirstamp)
rt/config.lo: rt/$(am__dirstamp)
diff --git a/libphobos/libdruntime/__builtins.di b/libphobos/libdruntime/__builtins.di
index cf05333..1c49035 100644
--- a/libphobos/libdruntime/__builtins.di
+++ b/libphobos/libdruntime/__builtins.di
@@ -15,7 +15,7 @@ module __builtins;
/* gcc relies on internal __builtin_xxxx functions and templates to
* accomplish <stdarg.h>. D does the same thing with templates in core.stdc.stdarg.
* Here, we redirect the gcc builtin declarations to the equivalent
- * ones in core.stdc.stdarg, thereby avoiding having to hardware them
+ * ones in core.stdc.stdarg, thereby avoiding having to hardwire them
* into the D compiler.
*/
diff --git a/libphobos/libdruntime/__main.di b/libphobos/libdruntime/__main.di
index 6dea7c2..5b50237 100644
--- a/libphobos/libdruntime/__main.di
+++ b/libphobos/libdruntime/__main.di
@@ -1,5 +1,5 @@
/* GDC -- D front-end for GCC
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2023 Free Software Foundation, Inc.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/config/aarch64/switchcontext.S b/libphobos/libdruntime/config/aarch64/switchcontext.S
index cf96e28..5cfa2f6 100644
--- a/libphobos/libdruntime/config/aarch64/switchcontext.S
+++ b/libphobos/libdruntime/config/aarch64/switchcontext.S
@@ -1,5 +1,5 @@
/* AArch64 support code for fibers and multithreading.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/config/arm/switchcontext.S b/libphobos/libdruntime/config/arm/switchcontext.S
index 562e0c7..3f9b35e 100644
--- a/libphobos/libdruntime/config/arm/switchcontext.S
+++ b/libphobos/libdruntime/config/arm/switchcontext.S
@@ -1,5 +1,5 @@
/* ARM support code for fibers and multithreading.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/config/common/threadasm.S b/libphobos/libdruntime/config/common/threadasm.S
index d39014b..67c06fa 100644
--- a/libphobos/libdruntime/config/common/threadasm.S
+++ b/libphobos/libdruntime/config/common/threadasm.S
@@ -1,5 +1,5 @@
/* Support code for fibers and multithreading.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/config/mingw/msvc.c b/libphobos/libdruntime/config/mingw/msvc.c
index 348b223..85a2d6d 100644
--- a/libphobos/libdruntime/config/mingw/msvc.c
+++ b/libphobos/libdruntime/config/mingw/msvc.c
@@ -1,6 +1,6 @@
/* Windows support code to wrap differences between different
versions of the Microsoft C libaries.
- Copyright (C) 2021-2022 Free Software Foundation, Inc.
+ Copyright (C) 2021-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/config/mingw/switchcontext.S b/libphobos/libdruntime/config/mingw/switchcontext.S
index 458e599..bc05454 100644
--- a/libphobos/libdruntime/config/mingw/switchcontext.S
+++ b/libphobos/libdruntime/config/mingw/switchcontext.S
@@ -1,5 +1,5 @@
/* Windows i386 support code for fibers and multithreading.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/config/mips/switchcontext.S b/libphobos/libdruntime/config/mips/switchcontext.S
index 7c626ea..13df200 100644
--- a/libphobos/libdruntime/config/mips/switchcontext.S
+++ b/libphobos/libdruntime/config/mips/switchcontext.S
@@ -1,5 +1,5 @@
/* MIPS support code for fibers and multithreading.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/config/powerpc/switchcontext.S b/libphobos/libdruntime/config/powerpc/switchcontext.S
index 376a221..10db856 100644
--- a/libphobos/libdruntime/config/powerpc/switchcontext.S
+++ b/libphobos/libdruntime/config/powerpc/switchcontext.S
@@ -1,5 +1,5 @@
/* PowerPC support code for fibers and multithreading.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/config/s390/get_tls_offset.S b/libphobos/libdruntime/config/s390/get_tls_offset.S
index 6d5d5d4..6d797ad 100644
--- a/libphobos/libdruntime/config/s390/get_tls_offset.S
+++ b/libphobos/libdruntime/config/s390/get_tls_offset.S
@@ -1,5 +1,5 @@
/* IBM Z support code for TLS offsets.
- Copyright (C) 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2020-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/config/systemz/get_tls_offset.S b/libphobos/libdruntime/config/systemz/get_tls_offset.S
index ffb9687..0ff4fc3 100644
--- a/libphobos/libdruntime/config/systemz/get_tls_offset.S
+++ b/libphobos/libdruntime/config/systemz/get_tls_offset.S
@@ -1,5 +1,5 @@
/* IBM Z support code for TLS offsets.
- Copyright (C) 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2020-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/config/x86/switchcontext.S b/libphobos/libdruntime/config/x86/switchcontext.S
index a64fdb0..008a76e 100644
--- a/libphobos/libdruntime/config/x86/switchcontext.S
+++ b/libphobos/libdruntime/config/x86/switchcontext.S
@@ -1,5 +1,5 @@
/* i386 support code for fibers and multithreading.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/core/attribute.d b/libphobos/libdruntime/core/attribute.d
index 8a1dc8a..c2a7c33 100644
--- a/libphobos/libdruntime/core/attribute.d
+++ b/libphobos/libdruntime/core/attribute.d
@@ -236,9 +236,9 @@ version (UdaGNUAbiTag) struct gnuAbiTag
{
string[] tags;
- this(string[] tags...)
+ this(string[] tags...) @safe pure nothrow
{
- this.tags = tags;
+ this.tags = tags.dup;
}
}
diff --git a/libphobos/libdruntime/core/cpuid.d b/libphobos/libdruntime/core/cpuid.d
index 1c2ac06..b79bd1d 100644
--- a/libphobos/libdruntime/core/cpuid.d
+++ b/libphobos/libdruntime/core/cpuid.d
@@ -1080,7 +1080,7 @@ void cpuidSparc()
}
*/
-shared static this()
+pragma(crt_constructor) void cpuid_initialization()
{
auto cf = getCpuFeatures();
diff --git a/libphobos/libdruntime/core/demangle.d b/libphobos/libdruntime/core/demangle.d
index ca87f90..3fcb266 100644
--- a/libphobos/libdruntime/core/demangle.d
+++ b/libphobos/libdruntime/core/demangle.d
@@ -24,6 +24,11 @@ else version (WatchOS)
debug(trace) import core.stdc.stdio : printf;
debug(info) import core.stdc.stdio : printf;
+extern (C) alias CXX_DEMANGLER = char* function (const char* mangled_name,
+ char* output_buffer,
+ size_t* length,
+ int* status) nothrow pure @trusted;
+
private struct NoHooks
{
// supported hooks
@@ -82,7 +87,7 @@ pure @safe:
static class ParseException : Exception
{
- @safe pure nothrow this( string msg )
+ this(string msg) @safe pure nothrow
{
super( msg );
}
@@ -91,14 +96,14 @@ pure @safe:
static class OverflowException : Exception
{
- @safe pure nothrow this( string msg )
+ this(string msg) @safe pure nothrow
{
super( msg );
}
}
- static void error( string msg = "Invalid symbol" ) @trusted /* exception only used in module */
+ static noreturn error( string msg = "Invalid symbol" ) @trusted /* exception only used in module */
{
pragma(inline, false); // tame dmd inliner
@@ -110,7 +115,7 @@ pure @safe:
}
- static void overflow( string msg = "Buffer overflow" ) @trusted /* exception only used in module */
+ static noreturn overflow( string msg = "Buffer overflow" ) @trusted /* exception only used in module */
{
pragma(inline, false); // tame dmd inliner
@@ -156,7 +161,6 @@ pure @safe:
if (val >= '0' && val <= '9')
return cast(ubyte)(val - '0');
error();
- return 0;
}
@@ -253,23 +257,22 @@ pure @safe:
put(", ");
}
- char[] put(char c) return scope
+ void put(char c) return scope
{
char[1] val = c;
- return put(val[]);
+ put(val[]);
}
- char[] put( scope const(char)[] val ) return scope
+ void put(scope const(char)[] val) return scope
{
pragma(inline, false); // tame dmd inliner
- if ( val.length )
- {
- if ( !contains( dst[0 .. len], val ) )
- return append( val );
- return shift( val );
- }
- return null;
+ if (!val.length) return;
+
+ if (!contains(dst[0 .. len], val))
+ append(val);
+ else
+ shift(val);
}
@@ -798,7 +801,7 @@ pure @safe:
TypeTuple:
B Number Arguments
*/
- char[] parseType( char[] name = null ) return scope
+ char[] parseType() return scope
{
static immutable string[23] primitives = [
"char", // a
@@ -827,7 +830,7 @@ pure @safe:
];
static if (__traits(hasMember, Hooks, "parseType"))
- if (auto n = hooks.parseType(this, name))
+ if (auto n = hooks.parseType(this, null))
return n;
debug(trace) printf( "parseType+\n" );
@@ -858,27 +861,24 @@ pure @safe:
switch ( t )
{
case 'Q': // Type back reference
- return parseBackrefType( () => parseType( name ) );
+ return parseBackrefType(() => parseType());
case 'O': // Shared (O Type)
popFront();
put( "shared(" );
parseType();
put( ')' );
- pad( name );
return dst[beg .. len];
case 'x': // Const (x Type)
popFront();
put( "const(" );
parseType();
put( ')' );
- pad( name );
return dst[beg .. len];
case 'y': // Immutable (y Type)
popFront();
put( "immutable(" );
parseType();
put( ')' );
- pad( name );
return dst[beg .. len];
case 'N':
popFront();
@@ -909,7 +909,6 @@ pure @safe:
popFront();
parseType();
put( "[]" );
- pad( name );
return dst[beg .. len];
case 'G': // TypeStaticArray (G Number Type)
popFront();
@@ -918,7 +917,6 @@ pure @safe:
put( '[' );
put( num );
put( ']' );
- pad( name );
return dst[beg .. len];
case 'H': // TypeAssocArray (H Type Type)
popFront();
@@ -928,38 +926,36 @@ pure @safe:
put( '[' );
put( tx );
put( ']' );
- pad( name );
return dst[beg .. len];
case 'P': // TypePointer (P Type)
popFront();
parseType();
put( '*' );
- pad( name );
return dst[beg .. len];
case 'F': case 'U': case 'W': case 'V': case 'R': // TypeFunction
- return parseTypeFunction( name );
+ return parseTypeFunction();
case 'C': // TypeClass (C LName)
case 'S': // TypeStruct (S LName)
case 'E': // TypeEnum (E LName)
case 'T': // TypeTypedef (T LName)
popFront();
parseQualifiedName();
- pad( name );
return dst[beg .. len];
case 'D': // TypeDelegate (D TypeFunction)
popFront();
- auto modbeg = len;
- parseModifier();
- auto modend = len;
+ auto modifiers = parseModifier();
if ( front == 'Q' )
- parseBackrefType( () => parseTypeFunction( name, IsDelegate.yes ) );
+ parseBackrefType(() => parseTypeFunction(IsDelegate.yes));
else
- parseTypeFunction( name, IsDelegate.yes );
- if (modend > modbeg)
+ parseTypeFunction(IsDelegate.yes);
+ if (modifiers)
{
- // move modifiers behind the function arguments
- shift(dst[modend-1 .. modend]); // trailing space
- shift(dst[modbeg .. modend-1]);
+ // write modifiers behind the function arguments
+ while (auto str = typeCtors.toStringConsume(modifiers))
+ {
+ put(' ');
+ put(str);
+ }
}
return dst[beg .. len];
case 'n': // TypeNone (n)
@@ -985,7 +981,6 @@ pure @safe:
{
popFront();
put( primitives[cast(size_t)(t - 'a')] );
- pad( name );
return dst[beg .. len];
}
else if (t == 'z')
@@ -996,12 +991,10 @@ pure @safe:
case 'i':
popFront();
put( "cent" );
- pad( name );
return dst[beg .. len];
case 'k':
popFront();
put( "ucent" );
- pad( name );
return dst[beg .. len];
default:
error();
@@ -1009,7 +1002,6 @@ pure @safe:
}
}
error();
- return null;
}
}
@@ -1110,43 +1102,44 @@ pure @safe:
}
}
- void parseModifier()
+ /// Returns: Flags of `TypeCtor`
+ ushort parseModifier()
{
+ TypeCtor res = TypeCtor.None;
switch ( front )
{
case 'y':
popFront();
- put( "immutable " );
- break;
+ return TypeCtor.Immutable;
case 'O':
popFront();
- put( "shared " );
- if ( front == 'x' )
+ res |= TypeCtor.Shared;
+ if (front == 'x')
goto case 'x';
- if ( front == 'N' )
+ if (front == 'N')
goto case 'N';
- break;
+ return TypeCtor.Shared;
case 'N':
- if ( peek( 1 ) != 'g' )
- break;
+ if (peek( 1 ) != 'g')
+ return res;
popFront();
popFront();
- put( "inout " );
+ res |= TypeCtor.InOut;
if ( front == 'x' )
goto case 'x';
- break;
+ return res;
case 'x':
popFront();
- put( "const " );
- break;
- default: break;
+ res |= TypeCtor.Const;
+ return res;
+ default: return TypeCtor.None;
}
}
- void parseFuncAttr()
+ ushort parseFuncAttr()
{
// FuncAttrs
- breakFuncAttrs:
+ ushort result;
while ('N' == front)
{
popFront();
@@ -1154,27 +1147,27 @@ pure @safe:
{
case 'a': // FuncAttrPure
popFront();
- put( "pure " );
+ result |= FuncAttributes.Pure;
continue;
case 'b': // FuncAttrNoThrow
popFront();
- put( "nothrow " );
+ result |= FuncAttributes.Nothrow;
continue;
case 'c': // FuncAttrRef
popFront();
- put( "ref " );
+ result |= FuncAttributes.Ref;
continue;
case 'd': // FuncAttrProperty
popFront();
- put( "@property " );
+ result |= FuncAttributes.Property;
continue;
case 'e': // FuncAttrTrusted
popFront();
- put( "@trusted " );
+ result |= FuncAttributes.Trusted;
continue;
case 'f': // FuncAttrSafe
popFront();
- put( "@safe " );
+ result |= FuncAttributes.Safe;
continue;
case 'g':
case 'h':
@@ -1188,27 +1181,42 @@ pure @safe:
// if we see these, then we know we're really in
// the parameter list. Rewind and break.
pos--;
- break breakFuncAttrs;
+ return result;
case 'i': // FuncAttrNogc
popFront();
- put( "@nogc " );
+ result |= FuncAttributes.NoGC;
continue;
case 'j': // FuncAttrReturn
popFront();
- put( "return " );
+ if (this.peek(0) == 'N' && this.peek(1) == 'l')
+ {
+ result |= FuncAttributes.ReturnScope;
+ popFront();
+ popFront();
+ } else {
+ result |= FuncAttributes.Return;
+ }
continue;
case 'l': // FuncAttrScope
popFront();
- put( "scope " );
+ if (this.peek(0) == 'N' && this.peek(1) == 'j')
+ {
+ result |= FuncAttributes.ScopeReturn;
+ popFront();
+ popFront();
+ } else {
+ result |= FuncAttributes.Scope;
+ }
continue;
case 'm': // FuncAttrLive
popFront();
- put( "@live " );
+ result |= FuncAttributes.Live;
continue;
default:
error();
}
}
+ return result;
}
void parseFuncArguments() scope
@@ -1339,42 +1347,33 @@ pure @safe:
TypeFunction:
CallConvention FuncAttrs Arguments ArgClose Type
*/
- char[] parseTypeFunction( char[] name = null, IsDelegate isdg = IsDelegate.no ) return scope
+ char[] parseTypeFunction(IsDelegate isdg = IsDelegate.no) return scope
{
debug(trace) printf( "parseTypeFunction+\n" );
debug(trace) scope(success) printf( "parseTypeFunction-\n" );
auto beg = len;
parseCallConvention();
- auto attrbeg = len;
- parseFuncAttr();
+ auto attributes = parseFuncAttr();
auto argbeg = len;
put( '(' );
parseFuncArguments();
put( ')' );
- if (attrbeg < argbeg)
+ if (attributes)
{
- // move function attributes behind arguments
- shift( dst[argbeg - 1 .. argbeg] ); // trailing space
- shift( dst[attrbeg .. argbeg - 1] ); // attributes
- argbeg = attrbeg;
+ // write function attributes behind arguments
+ while (auto str = funcAttrs.toStringConsume(attributes))
+ {
+ put(' ');
+ put(str);
+ }
}
auto retbeg = len;
parseType();
put( ' ' );
- // append name/delegate/function
- if ( name.length )
- {
- if ( !contains( dst[0 .. len], name ) )
- put( name );
- else if ( shift( name ).ptr != name.ptr )
- {
- argbeg -= name.length;
- retbeg -= name.length;
- }
- }
- else if ( IsDelegate.yes == isdg )
+ // append delegate/function
+ if (IsDelegate.yes == isdg)
put( "delegate" );
else
put( "function" );
@@ -1900,21 +1899,26 @@ pure @safe:
{
// do not emit "needs this"
popFront();
- parseModifier();
+ auto modifiers = parseModifier();
+ while (auto str = typeCtors.toStringConsume(modifiers))
+ {
+ put(str);
+ put(' ');
+ }
}
if ( isCallConvention( front ) )
{
// we don't want calling convention and attributes in the qualified name
parseCallConvention();
- parseFuncAttr();
- if ( keepAttr )
- {
+ auto attributes = parseFuncAttr();
+ if (keepAttr) {
+ while (auto str = funcAttrs.toStringConsume(attributes))
+ {
+ put(str);
+ put(' ');
+ }
attr = dst[prevlen .. len];
}
- else
- {
- len = prevlen;
- }
put( '(' );
parseFuncArguments();
@@ -2095,19 +2099,22 @@ pure @safe:
/**
- * Demangles D mangled names. If it is not a D mangled name, it returns its
- * argument name.
+ * Demangles D/C++ mangled names. If it is not a D/C++ mangled name, it
+ * returns its argument name.
*
* Params:
* buf = The string to demangle.
* dst = An optional destination buffer.
+ * __cxa_demangle = optional C++ demangler
*
* Returns:
- * The demangled name or the original string if the name is not a mangled D
- * name.
+ * The demangled name or the original string if the name is not a mangled
+ * D/C++ name.
*/
-char[] demangle(return scope const(char)[] buf, return scope char[] dst = null ) nothrow pure @safe
+char[] demangle(return scope const(char)[] buf, return scope char[] dst = null, CXX_DEMANGLER __cxa_demangle = null) nothrow pure @safe
{
+ if (__cxa_demangle && buf.length > 2 && buf[0..2] == "_Z")
+ return demangleCXX(buf, __cxa_demangle, dst);
auto d = Demangle!()(buf, dst);
// fast path (avoiding throwing & catching exception) for obvious
// non-D mangled names
@@ -2190,7 +2197,7 @@ char[] reencodeMangled(return scope const(char)[] mangled) nothrow pure @safe
}
}
- bool parseLName(scope ref Remangle d) scope
+ bool parseLName(scope ref Remangle d) scope @trusted
{
flushPosition(d);
@@ -2241,7 +2248,7 @@ char[] reencodeMangled(return scope const(char)[] mangled) nothrow pure @safe
}
else
{
- idpos[id] = refpos;
+ idpos[id] = refpos; //! scope variable id used as AA key, makes this function @trusted
result ~= d.buf[refpos .. d.pos];
}
}
@@ -2637,6 +2644,12 @@ else
["_D4test4rrs1FNkMJPiZv", "void test.rrs1(return scope out int*)"],
["_D4test4rrs1FNkMKPiZv", "void test.rrs1(return scope ref int*)"],
["_D4test4rrs1FNkMPiZv", "void test.rrs1(return scope int*)"],
+
+ // `scope` and `return` combinations
+ ["_D3foo3Foo3barMNgFNjNlNfZNgPv", "inout return scope @safe inout(void*) foo.Foo.bar()"],
+ ["_D3foo3FooQiMNgFNlNfZv", "inout scope @safe void foo.Foo.foo()"],
+ ["_D3foo3Foo4foorMNgFNjNfZv", "inout return @safe void foo.Foo.foor()"],
+ ["_D3foo3Foo3rabMNgFNlNjNfZv", "inout scope return @safe void foo.Foo.rab()"],
];
@@ -2680,8 +2693,10 @@ unittest
{
char[] buf = new char[i];
auto ds = demangle(s, buf);
- assert(ds == "pure nothrow @safe char[] core.demangle.demangle(scope return const(char)[], scope return char[])" ||
- ds == "pure nothrow @safe char[] core.demangle.demangle(return scope const(char)[], return scope char[])");
+ assert(ds == "pure nothrow @safe char[] core.demangle.demangle(scope return const(char)[], scope return char[], extern (C) char* function(const(char*), char*, ulong*, int*) pure nothrow @trusted*)" ||
+ ds == "pure nothrow @safe char[] core.demangle.demangle(return scope const(char)[], return scope char[], extern (C) char* function(const(char*), char*, ulong*, int*) pure nothrow @trusted*)" ||
+ ds == "pure nothrow @safe char[] core.demangle.demangle(scope return const(char)[], scope return char[], extern (C) char* function(const(char*), char*, uint*, int*) pure nothrow @trusted*)" ||
+ ds == "pure nothrow @safe char[] core.demangle.demangle(return scope const(char)[], return scope char[], extern (C) char* function(const(char*), char*, uint*, int*) pure nothrow @trusted*)", ds);
}
}
@@ -2698,6 +2713,9 @@ unittest
s ~= "FiZi";
expected ~= "F";
assert(s.demangle == expected);
+
+ // https://issues.dlang.org/show_bug.cgi?id=23562
+ assert(demangle("_Zv") == "_Zv");
}
// https://issues.dlang.org/show_bug.cgi?id=22235
@@ -2720,7 +2738,12 @@ unittest
}
/*
+ * Expand an OMF, DMD-generated compressed identifier into its full form
*
+ * This function only has a visible effect for OMF binaries (Win32),
+ * as compression is otherwise not used.
+ *
+ * See_Also: `compiler/src/dmd/backend/compress.d`
*/
string decodeDmdString( const(char)[] ln, ref size_t p ) nothrow pure @safe
{
@@ -2781,3 +2804,166 @@ extern (C) private
errno = err;
}
}
+
+private struct ManglingFlagInfo
+{
+ /// The flag value to use
+ ushort flag;
+
+ /// Human-readable representation
+ string value;
+}
+
+private enum TypeCtor : ushort {
+ None = 0,
+ //// 'x'
+ Const = (1 << 1),
+ /// 'y'
+ Immutable = (1 << 2),
+ /// 'O'
+ Shared = (1 << 3),
+ ///
+ InOut = (1 << 4),
+}
+
+private immutable ManglingFlagInfo[] typeCtors = [
+ ManglingFlagInfo(TypeCtor.Immutable, "immutable"),
+ ManglingFlagInfo(TypeCtor.Shared, "shared"),
+ ManglingFlagInfo(TypeCtor.InOut, "inout"),
+ ManglingFlagInfo(TypeCtor.Const, "const"),
+];
+
+private enum FuncAttributes : ushort {
+ None = 0,
+ //// 'a'
+ Pure = (1 << 1),
+ //// 'b'
+ Nothrow = (1 << 2),
+ //// 'c'
+ Ref = (1 << 3),
+ //// 'd'
+ Property = (1 << 4),
+ //// 'e'
+ Trusted = (1 << 5),
+ //// 'f'
+ Safe = (1 << 6),
+ //// 'i'
+ NoGC = (1 << 7),
+ //// 'j'
+ Return = (1 << 8),
+ //// 'l'
+ Scope = (1 << 9),
+ //// 'm'
+ Live = (1 << 10),
+
+ /// Their order matter
+ ReturnScope = (1 << 11),
+ ScopeReturn = (1 << 12),
+}
+
+// The order in which we process is the same as in compiler/dmd/src/dmangle.d
+private immutable ManglingFlagInfo[] funcAttrs = [
+ ManglingFlagInfo(FuncAttributes.Pure, "pure"),
+ ManglingFlagInfo(FuncAttributes.Nothrow, "nothrow"),
+ ManglingFlagInfo(FuncAttributes.Ref, "ref"),
+ ManglingFlagInfo(FuncAttributes.Property, "@property"),
+ ManglingFlagInfo(FuncAttributes.NoGC, "@nogc"),
+
+ ManglingFlagInfo(FuncAttributes.ReturnScope, "return scope"),
+ ManglingFlagInfo(FuncAttributes.ScopeReturn, "scope return"),
+
+ ManglingFlagInfo(FuncAttributes.Return, "return"),
+ ManglingFlagInfo(FuncAttributes.Scope, "scope"),
+
+ ManglingFlagInfo(FuncAttributes.Live, "@live"),
+ ManglingFlagInfo(FuncAttributes.Trusted, "@trusted"),
+ ManglingFlagInfo(FuncAttributes.Safe, "@safe"),
+];
+
+private string toStringConsume (immutable ManglingFlagInfo[] infos, ref ushort base)
+ @safe pure nothrow @nogc
+{
+ foreach (const ref info; infos)
+ {
+ if ((base & info.flag) == info.flag)
+ {
+ base &= ~info.flag;
+ return info.value;
+ }
+ }
+ return null;
+}
+
+private shared CXX_DEMANGLER __cxa_demangle;
+
+/**
+ * Returns:
+ * a CXX_DEMANGLER if a C++ stdlib is loaded
+ */
+
+CXX_DEMANGLER getCXXDemangler() nothrow @trusted
+{
+ if (__cxa_demangle is null)
+ version (Posix)
+ {
+ import core.sys.posix.dlfcn : dlsym;
+ version (DragonFlyBSD) import core.sys.dragonflybsd.dlfcn : RTLD_DEFAULT;
+ version (FreeBSD) import core.sys.freebsd.dlfcn : RTLD_DEFAULT;
+ version (linux) import core.sys.linux.dlfcn : RTLD_DEFAULT;
+ version (NetBSD) import core.sys.netbsd.dlfcn : RTLD_DEFAULT;
+ version (OpenBSD) import core.sys.openbsd.dlfcn : RTLD_DEFAULT;
+ version (Darwin) import core.sys.darwin.dlfcn : RTLD_DEFAULT;
+ version (Solaris) import core.sys.solaris.dlfcn : RTLD_DEFAULT;
+
+ if (auto found = cast(CXX_DEMANGLER) dlsym(RTLD_DEFAULT, "__cxa_demangle"))
+ __cxa_demangle = found;
+ }
+
+ if (__cxa_demangle is null)
+ __cxa_demangle = (const char* mangled_name, char* output_buffer,
+ size_t* length, int* status) nothrow pure @trusted {
+ *status = -1;
+ return null;
+ };
+
+ return __cxa_demangle;
+}
+
+/**
+ * Demangles C++ mangled names. If it is not a C++ mangled name, it
+ * returns its argument name.
+ *
+ * Params:
+ * buf = The string to demangle.
+ * __cxa_demangle = C++ demangler
+ * dst = An optional destination buffer.
+ *
+ * Returns:
+ * The demangled name or the original string if the name is not a mangled
+ * C++ name.
+ */
+private char[] demangleCXX(return scope const(char)[] buf, CXX_DEMANGLER __cxa_demangle, return scope char[] dst = null,) nothrow pure @trusted
+{
+ char[] c_string = dst; // temporarily use dst buffer if possible
+ c_string.length = buf.length + 1;
+ c_string[0 .. buf.length] = buf[0 .. buf.length];
+ c_string[buf.length] = '\0';
+
+ int status;
+ size_t demangled_length;
+ auto demangled = __cxa_demangle(&c_string[0], null, &demangled_length, &status);
+ scope (exit) {
+ import core.memory;
+ pureFree(cast(void*) demangled);
+ }
+ if (status == 0)
+ {
+ dst.length = demangled_length;
+ dst[] = demangled[0 .. demangled_length];
+ return dst;
+ }
+
+ dst.length = buf.length;
+ dst[] = buf[];
+ return dst;
+}
diff --git a/libphobos/libdruntime/core/exception.d b/libphobos/libdruntime/core/exception.d
index a05a24c..d2016b1 100644
--- a/libphobos/libdruntime/core/exception.d
+++ b/libphobos/libdruntime/core/exception.d
@@ -278,7 +278,6 @@ class FinalizeError : Error
this( TypeInfo ci, string file = __FILE__, size_t line = __LINE__, Throwable next = null ) @safe pure nothrow @nogc
{
super( "Finalization error", file, line, next );
- super.info = SuppressTraceInfo.instance;
info = ci;
}
@@ -393,7 +392,6 @@ class InvalidMemoryOperationError : Error
this(string file = __FILE__, size_t line = __LINE__, Throwable next = null ) @safe pure nothrow @nogc
{
super( "Invalid memory operation", file, line, next );
- this.info = SuppressTraceInfo.instance;
}
override string toString() const @trusted
@@ -608,7 +606,7 @@ extern (C) void onUnittestErrorMsg( string file, size_t line, string msg ) nothr
* Throws:
* $(LREF RangeError).
*/
-extern (C) void onRangeError( string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogc
+extern (C) noreturn onRangeError( string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogc
{
throw staticError!RangeError(file, line, null);
}
@@ -626,7 +624,7 @@ extern (C) void onRangeError( string file = __FILE__, size_t line = __LINE__ ) @
* Throws:
* $(LREF ArraySliceError).
*/
-extern (C) void onArraySliceError( size_t lower = 0, size_t upper = 0, size_t length = 0,
+extern (C) noreturn onArraySliceError( size_t lower = 0, size_t upper = 0, size_t length = 0,
string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogc
{
throw staticError!ArraySliceError(lower, upper, length, file, line, null);
@@ -644,7 +642,7 @@ extern (C) void onArraySliceError( size_t lower = 0, size_t upper = 0, size_t le
* Throws:
* $(LREF ArrayIndexError).
*/
-extern (C) void onArrayIndexError( size_t index = 0, size_t length = 0,
+extern (C) noreturn onArrayIndexError( size_t index = 0, size_t length = 0,
string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogc
{
throw staticError!ArrayIndexError(index, length, file, line, null);
@@ -662,7 +660,7 @@ extern (C) void onArrayIndexError( size_t index = 0, size_t length = 0,
* Throws:
* $(LREF FinalizeError).
*/
-extern (C) void onFinalizeError( TypeInfo info, Throwable e, string file = __FILE__, size_t line = __LINE__ ) @trusted nothrow
+extern (C) noreturn onFinalizeError( TypeInfo info, Throwable e, string file = __FILE__, size_t line = __LINE__ ) @trusted nothrow
{
// This error is thrown during a garbage collection, so no allocation must occur while
// generating this object. So we use a preallocated instance
@@ -679,13 +677,13 @@ version (D_BetterC)
// templates even for ordinary builds instead of providing them as an
// extern(C) library.
- void onOutOfMemoryError()(void* pretend_sideffect = null) @nogc nothrow pure @trusted
+ noreturn onOutOfMemoryError()(void* pretend_sideffect = null) @nogc nothrow pure @trusted
{
assert(0, "Memory allocation failed");
}
alias onOutOfMemoryErrorNoGC = onOutOfMemoryError;
- void onInvalidMemoryOperationError()(void* pretend_sideffect = null) @nogc nothrow pure @trusted
+ noreturn onInvalidMemoryOperationError()(void* pretend_sideffect = null) @nogc nothrow pure @trusted
{
assert(0, "Invalid memory operation");
}
@@ -699,14 +697,14 @@ else
* Throws:
* $(LREF OutOfMemoryError).
*/
- extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
+ extern (C) noreturn onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
{
// NOTE: Since an out of memory condition exists, no allocation must occur
// while generating this object.
throw staticError!OutOfMemoryError();
}
- extern (C) void onOutOfMemoryErrorNoGC() @trusted nothrow @nogc
+ extern (C) noreturn onOutOfMemoryErrorNoGC() @trusted nothrow @nogc
{
// suppress stacktrace until they are @nogc
throw staticError!OutOfMemoryError(false);
@@ -720,7 +718,7 @@ else
* Throws:
* $(LREF InvalidMemoryOperationError).
*/
-extern (C) void onInvalidMemoryOperationError(void* pretend_sideffect = null) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
+extern (C) noreturn onInvalidMemoryOperationError(void* pretend_sideffect = null) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
{
// The same restriction applies as for onOutOfMemoryError. The GC is in an
// undefined state, thus no allocation must occur while generating this object.
@@ -738,7 +736,7 @@ extern (C) void onInvalidMemoryOperationError(void* pretend_sideffect = null) @t
* Throws:
* $(LREF ConfigurationError).
*/
-extern (C) void onForkError( string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogc
+extern (C) noreturn onForkError( string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogc
{
throw staticError!ForkError( file, line, null );
}
@@ -755,7 +753,7 @@ extern (C) void onForkError( string file = __FILE__, size_t line = __LINE__ ) @t
* Throws:
* $(LREF UnicodeException).
*/
-extern (C) void onUnicodeError( string msg, size_t idx, string file = __FILE__, size_t line = __LINE__ ) @safe pure
+extern (C) noreturn onUnicodeError( string msg, size_t idx, string file = __FILE__, size_t line = __LINE__ ) @safe pure
{
throw new UnicodeException( msg, idx, file, line );
}
@@ -859,7 +857,7 @@ extern (C)
private align(2 * size_t.sizeof) void[256] _store;
// only Errors for now as those are rarely chained
-private T staticError(T, Args...)(auto ref Args args)
+package T staticError(T, Args...)(auto ref Args args)
if (is(T : Error))
{
// pure hack, what we actually need is @noreturn and allow to call that in pure functions
diff --git a/libphobos/libdruntime/core/factory.d b/libphobos/libdruntime/core/factory.d
new file mode 100644
index 0000000..f45a04e
--- /dev/null
+++ b/libphobos/libdruntime/core/factory.d
@@ -0,0 +1,68 @@
+/* Create classes from their modules and names.
+ *
+ * Copyright: Copyright (C) D Language Foundation 2023
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
+ * Authors: Walter Bright, Steven Schveighoffer
+ * Source: $(DRUNTIMESRC core/_factory.d)
+ */
+
+module core.factory;
+
+/**
+ * Create instance of class specified by the module symbol and a string
+ * representing the name of the class.
+ * The class must either have no constructors or have
+ * a default constructor.
+ * Params:
+ * mod = symbol representing the module that the class is in
+ * classname = string representing the name of the class
+ * Returns:
+ * null if failed
+ * Example:
+ * ---
+ * module foo.bar;
+ *
+ * class C
+ * {
+ * this() { x = 10; }
+ * int x;
+ * }
+ *
+ * void main()
+ * {
+ * auto c = cast(C)factory!(foo.bar)("C");
+ * assert(c !is null && c.x == 10);
+ * }
+ * ---
+ */
+Object factory(alias mod)(string classname)
+{
+ foreach(cl; _getModuleClasses!mod)
+ {
+ if (cl.stringof == classname)
+ return cl.classinfo.create();
+ }
+ return null;
+}
+
+@system unittest
+{
+ Object valid_obj = factory!object("Object");
+ Object invalid_obj = factory!object("__this_class_doesnt_exist__");
+
+ assert(valid_obj !is null);
+ assert(invalid_obj is null);
+}
+
+/**************************************
+ * Retrieve as a tuple all the types of the top level classes in the module mod.
+ */
+private template _getModuleClasses(alias mod) {
+ alias result = _AliasSeq!();
+ static foreach(m; __traits(allMembers, mod))
+ static if(is(__traits(getMember, mod, m) == class))
+ result = _AliasSeq!(result, __traits(getMember, mod, m));
+ alias _getModuleClasses = result;
+}
+
+private template _AliasSeq(TList...) { alias _AliasSeq = TList; }
diff --git a/libphobos/libdruntime/core/int128.d b/libphobos/libdruntime/core/int128.d
index 46eb9b2..20fa7de 100644
--- a/libphobos/libdruntime/core/int128.d
+++ b/libphobos/libdruntime/core/int128.d
@@ -18,8 +18,23 @@ alias I = long;
alias U = ulong;
enum Ubits = uint(U.sizeof * 8);
-version (X86_64) private enum Cent_alignment = 16;
-else private enum Cent_alignment = (size_t.sizeof * 2);
+version (DigitalMars)
+{
+ /* The alignment should follow target.stackAlign(),
+ * which is `isXmmSupported() ? 16 : (is64bit ? 8 : 4)
+ */
+ version (D_SIMD)
+ private enum Cent_alignment = 16;
+ else version (X86_64)
+ private enum Cent_alignment = 8;
+ else
+ private enum Cent_alignment = 4;
+}
+else
+{
+ version (X86_64) private enum Cent_alignment = 16;
+ else private enum Cent_alignment = (size_t.sizeof * 2);
+}
align(Cent_alignment) struct Cent
{
diff --git a/libphobos/libdruntime/core/internal/array/appending.d b/libphobos/libdruntime/core/internal/array/appending.d
index 616d27c..b609167 100644
--- a/libphobos/libdruntime/core/internal/array/appending.d
+++ b/libphobos/libdruntime/core/internal/array/appending.d
@@ -17,8 +17,6 @@ private enum isCopyingNothrow(T) = __traits(compiles, (ref T rhs) nothrow { T lh
/// Implementation of `_d_arrayappendcTX` and `_d_arrayappendcTXTrace`
template _d_arrayappendcTXImpl(Tarr : T[], T)
{
- import core.internal.array.utils : _d_HookTraceImpl;
-
private enum errorMessage = "Cannot append to array if compiling without support for runtime type information!";
/**
@@ -51,17 +49,22 @@ template _d_arrayappendcTXImpl(Tarr : T[], T)
return px;
}
else
- assert(0, "Cannot append arrays if compiling without support for runtime type information!");
+ assert(0, errorMessage);
}
- /**
- * TraceGC wrapper around $(REF _d_arrayappendcTX, rt,array,appending,_d_arrayappendcTXImpl).
- * Bugs:
- * This function template was ported from a much older runtime hook that bypassed safety,
- * purity, and throwabilty checks. To prevent breaking existing code, this function template
- * is temporarily declared `@trusted pure` until the implementation can be brought up to modern D expectations.
- */
- alias _d_arrayappendcTXTrace = _d_HookTraceImpl!(Tarr, _d_arrayappendcTX, errorMessage);
+ version (D_ProfileGC)
+ {
+ import core.internal.array.utils : _d_HookTraceImpl;
+
+ /**
+ * TraceGC wrapper around $(REF _d_arrayappendcTX, rt,array,appending,_d_arrayappendcTXImpl).
+ * Bugs:
+ * This function template was ported from a much older runtime hook that bypassed safety,
+ * purity, and throwabilty checks. To prevent breaking existing code, this function template
+ * is temporarily declared `@trusted pure` until the implementation can be brought up to modern D expectations.
+ */
+ alias _d_arrayappendcTXTrace = _d_HookTraceImpl!(Tarr, _d_arrayappendcTX, errorMessage);
+ }
}
/// Implementation of `_d_arrayappendT`
@@ -71,7 +74,6 @@ ref Tarr _d_arrayappendT(Tarr : T[], T)(return ref scope Tarr x, scope Tarr y) @
import core.stdc.string : memcpy;
import core.internal.traits : hasElaborateCopyConstructor, Unqual;
- import core.lifetime : copyEmplace;
enum hasPostblit = __traits(hasPostblit, T);
auto length = x.length;
@@ -81,6 +83,8 @@ ref Tarr _d_arrayappendT(Tarr : T[], T)(return ref scope Tarr x, scope Tarr y) @
// Only call `copyEmplace` if `T` has a copy ctor and no postblit.
static if (hasElaborateCopyConstructor!T && !hasPostblit)
{
+ import core.lifetime : copyEmplace;
+
foreach (i, ref elem; y)
copyEmplace(elem, x[length + i]);
}
@@ -107,20 +111,23 @@ ref Tarr _d_arrayappendT(Tarr : T[], T)(return ref scope Tarr x, scope Tarr y) @
return x;
}
-/**
- * TraceGC wrapper around $(REF _d_arrayappendT, core,internal,array,appending).
- */
-ref Tarr _d_arrayappendTTrace(Tarr : T[], T)(string file, int line, string funcname, return ref scope Tarr x, scope Tarr y) @trusted
+version (D_ProfileGC)
{
- version (D_TypeInfo)
+ /**
+ * TraceGC wrapper around $(REF _d_arrayappendT, core,internal,array,appending).
+ */
+ ref Tarr _d_arrayappendTTrace(Tarr : T[], T)(string file, int line, string funcname, return ref scope Tarr x, scope Tarr y) @trusted
{
- import core.internal.array.utils: TraceHook, gcStatsPure, accumulatePure;
- mixin(TraceHook!(Tarr.stringof, "_d_arrayappendT"));
+ version (D_TypeInfo)
+ {
+ import core.internal.array.utils: TraceHook, gcStatsPure, accumulatePure;
+ mixin(TraceHook!(Tarr.stringof, "_d_arrayappendT"));
- return _d_arrayappendT(x, y);
+ return _d_arrayappendT(x, y);
+ }
+ else
+ assert(0, "Cannot append to array if compiling without support for runtime type information!");
}
- else
- assert(0, "Cannot append to array if compiling without support for runtime type information!");
}
@safe unittest
diff --git a/libphobos/libdruntime/core/internal/array/arrayassign.d b/libphobos/libdruntime/core/internal/array/arrayassign.d
index 6132e68..6e3c1fd 100644
--- a/libphobos/libdruntime/core/internal/array/arrayassign.d
+++ b/libphobos/libdruntime/core/internal/array/arrayassign.d
@@ -302,3 +302,151 @@ Tarr _d_arrayassign_r(Tarr : T[], T)(return scope Tarr to, scope Tarr from) @tru
assert(!didThrow);
assert(counter == 0);
}
+
+/**
+ * Sets all elements of an array to a single value. Takes into account postblits,
+ * copy constructors and destructors. For Plain Old Data elements,`rt/memset.d`
+ * is used.
+ *
+ * ---
+ * struct S
+ * {
+ * ~this() {} // destructor, so not Plain Old Data
+ * }
+ *
+ * void main()
+ * {
+ * S[3] arr;
+ * S value;
+ *
+ * arr = value;
+ * // Generates:
+ * // _d_arraysetassign(arr[], value), arr;
+ * }
+ * ---
+ *
+ * Params:
+ * to = destination array
+ * value = the element to set
+ * Returns:
+ * `to`
+ */
+Tarr _d_arraysetassign(Tarr : T[], T)(return scope Tarr to, scope ref T value) @trusted
+{
+ import core.internal.traits : Unqual;
+ import core.lifetime : copyEmplace;
+ import core.stdc.string : memcpy;
+
+ enum elemSize = T.sizeof;
+ void[elemSize] tmp = void;
+
+ foreach (ref dst; to)
+ {
+ memcpy(&tmp, cast(void*) &dst, elemSize);
+ // Use `memcpy` if `T` has a `@disable`d postblit.
+ static if (__traits(isCopyable, T))
+ copyEmplace(value, dst);
+ else
+ memcpy(cast(void*) &value, cast(void*) &dst, elemSize);
+ auto elem = cast(Unqual!T*) &tmp;
+ destroy(*elem);
+ }
+
+ return to;
+}
+
+// postblit and destructor
+@safe unittest
+{
+ string ops;
+ struct S
+ {
+ int val;
+ this(this) { ops ~= "="; }
+ ~this() { ops ~= "~"; }
+ }
+
+ S[4] arr;
+ S s = S(1234);
+ _d_arraysetassign(arr[], s);
+ assert(ops == "=~=~=~=~");
+ assert(arr == [S(1234), S(1234), S(1234), S(1234)]);
+}
+
+// copy constructor
+@safe unittest
+{
+ string ops;
+ struct S
+ {
+ int val;
+ this(const scope ref S rhs)
+ {
+ val = rhs.val;
+ ops ~= "=";
+ }
+ ~this() { ops ~= "~"; }
+ }
+
+ S[4] arr;
+ S s = S(1234);
+ _d_arraysetassign(arr[], s);
+ assert(ops == "=~=~=~=~");
+ assert(arr == [S(1234), S(1234), S(1234), S(1234)]);
+}
+
+// throwing and `nothrow`
+@safe nothrow unittest
+{
+ // Test that throwing works
+ bool didThrow;
+ int counter;
+ struct Throw
+ {
+ int val;
+ this(this)
+ {
+ counter++;
+ if (counter == 2)
+ throw new Exception("Oh no.");
+ }
+ }
+
+ try
+ {
+ Throw[4] a;
+ Throw b = Throw(1);
+ _d_arraysetassign(a[], b);
+ }
+ catch (Exception)
+ {
+ didThrow = true;
+ }
+ assert(didThrow);
+ assert(counter == 2);
+
+ // Test that `nothrow` works
+ didThrow = false;
+ counter = 0;
+ struct NoThrow
+ {
+ int val;
+ this(this) { counter++; }
+ }
+
+ try
+ {
+ NoThrow[4] a;
+ NoThrow b = NoThrow(1);
+ _d_arraysetassign(a[], b);
+ foreach (ref e; a)
+ assert(e == NoThrow(1));
+ }
+ catch (Exception)
+ {
+ didThrow = true;
+ }
+ assert(!didThrow);
+ // The array `a` is destroyed when the `try` block ends.
+ assert(counter == 4);
+}
diff --git a/libphobos/libdruntime/core/internal/array/capacity.d b/libphobos/libdruntime/core/internal/array/capacity.d
index 9440428..254e950 100644
--- a/libphobos/libdruntime/core/internal/array/capacity.d
+++ b/libphobos/libdruntime/core/internal/array/capacity.d
@@ -22,8 +22,6 @@ private extern (C) void[] _d_arraysetlengthiT(const TypeInfo ti, size_t newlengt
/// Implementation of `_d_arraysetlengthT` and `_d_arraysetlengthTTrace`
template _d_arraysetlengthTImpl(Tarr : T[], T)
{
- import core.internal.array.utils : _d_HookTraceImpl;
-
private enum errorMessage = "Cannot resize arrays if compiling without support for runtime type information!";
/**
@@ -54,14 +52,19 @@ template _d_arraysetlengthTImpl(Tarr : T[], T)
assert(0, errorMessage);
}
- /**
- * TraceGC wrapper around $(REF _d_arraysetlengthT, core,internal,array,core.internal.array.capacity).
- * Bugs:
- * This function template was ported from a much older runtime hook that bypassed safety,
- * purity, and throwabilty checks. To prevent breaking existing code, this function template
- * is temporarily declared `@trusted pure nothrow` until the implementation can be brought up to modern D expectations.
- */
- alias _d_arraysetlengthTTrace = _d_HookTraceImpl!(Tarr, _d_arraysetlengthT, errorMessage);
+ version (D_ProfileGC)
+ {
+ import core.internal.array.utils : _d_HookTraceImpl;
+
+ /**
+ * TraceGC wrapper around $(REF _d_arraysetlengthT, core,internal,array,core.internal.array.capacity).
+ * Bugs:
+ * This function template was ported from a much older runtime hook that bypassed safety,
+ * purity, and throwabilty checks. To prevent breaking existing code, this function template
+ * is temporarily declared `@trusted pure nothrow` until the implementation can be brought up to modern D expectations.
+ */
+ alias _d_arraysetlengthTTrace = _d_HookTraceImpl!(Tarr, _d_arraysetlengthT, errorMessage);
+ }
}
@safe unittest
diff --git a/libphobos/libdruntime/core/internal/array/concatenation.d b/libphobos/libdruntime/core/internal/array/concatenation.d
index 955e381..99f33da 100644
--- a/libphobos/libdruntime/core/internal/array/concatenation.d
+++ b/libphobos/libdruntime/core/internal/array/concatenation.d
@@ -14,8 +14,6 @@ private extern (C) void[] _d_arraycatnTX(const TypeInfo ti, scope byte[][] arrs)
/// Implementation of `_d_arraycatnTX` and `_d_arraycatnTXTrace`
template _d_arraycatnTXImpl(Tarr : ResultArrT[], ResultArrT : T[], T)
{
- import core.internal.array.utils : _d_HookTraceImpl;
-
private enum errorMessage = "Cannot concatenate arrays if compiling without support for runtime type information!";
/**
@@ -45,14 +43,19 @@ template _d_arraycatnTXImpl(Tarr : ResultArrT[], ResultArrT : T[], T)
assert(0, errorMessage);
}
- /**
- * TraceGC wrapper around $(REF _d_arraycatnTX, core,internal,array,concat).
- * Bugs:
- * This function template was ported from a much older runtime hook that bypassed safety,
- * purity, and throwabilty checks. To prevent breaking existing code, this function template
- * is temporarily declared `@trusted pure nothrow` until the implementation can be brought up to modern D expectations.
- */
- alias _d_arraycatnTXTrace = _d_HookTraceImpl!(ResultArrT, _d_arraycatnTX, errorMessage);
+ version (D_ProfileGC)
+ {
+ import core.internal.array.utils : _d_HookTraceImpl;
+
+ /**
+ * TraceGC wrapper around $(REF _d_arraycatnTX, core,internal,array,concat).
+ * Bugs:
+ * This function template was ported from a much older runtime hook that bypassed safety,
+ * purity, and throwabilty checks. To prevent breaking existing code, this function template
+ * is temporarily declared `@trusted pure nothrow` until the implementation can be brought up to modern D expectations.
+ */
+ alias _d_arraycatnTXTrace = _d_HookTraceImpl!(ResultArrT, _d_arraycatnTX, errorMessage);
+ }
}
@safe unittest
diff --git a/libphobos/libdruntime/core/internal/array/duplication.d b/libphobos/libdruntime/core/internal/array/duplication.d
index 41dfab6..21894c2 100644
--- a/libphobos/libdruntime/core/internal/array/duplication.d
+++ b/libphobos/libdruntime/core/internal/array/duplication.d
@@ -15,10 +15,17 @@ U[] _dup(T, U)(scope T[] a) pure nothrow @trusted if (__traits(isPOD, T))
if (__ctfe)
return _dupCtfe!(T, U)(a);
- import core.stdc.string : memcpy;
- auto arr = _d_newarrayU(typeid(T[]), a.length);
- memcpy(arr.ptr, cast(const(void)*) a.ptr, T.sizeof * a.length);
- return *cast(U[]*) &arr;
+ version (D_BetterC)
+ {
+ return _dupCtfe!(T, U)(a);
+ }
+ else
+ {
+ import core.stdc.string : memcpy;
+ auto arr = _d_newarrayU(typeid(T[]), a.length);
+ memcpy(arr.ptr, cast(const(void)*) a.ptr, T.sizeof * a.length);
+ return *cast(U[]*) &arr;
+ }
}
U[] _dupCtfe(T, U)(scope T[] a)
@@ -41,25 +48,32 @@ U[] _dup(T, U)(T[] a) if (!__traits(isPOD, T))
if (__ctfe)
return _dupCtfe!(T, U)(a);
- import core.lifetime: copyEmplace;
- U[] res = () @trusted {
- auto arr = cast(U*) _d_newarrayU(typeid(T[]), a.length);
- size_t i;
- scope (failure)
- {
- import core.internal.lifetime: emplaceInitializer;
- // Initialize all remaining elements to not destruct garbage
- foreach (j; i .. a.length)
- emplaceInitializer(cast() arr[j]);
- }
- for (; i < a.length; i++)
- {
- copyEmplace(a.ptr[i], arr[i]);
- }
- return cast(U[])(arr[0..a.length]);
- } ();
+ version (D_BetterC)
+ {
+ return _dupCtfe!(T, U)(a);
+ }
+ else
+ {
+ import core.lifetime: copyEmplace;
+ U[] res = () @trusted {
+ auto arr = cast(U*) _d_newarrayU(typeid(T[]), a.length);
+ size_t i;
+ scope (failure)
+ {
+ import core.internal.lifetime: emplaceInitializer;
+ // Initialize all remaining elements to not destruct garbage
+ foreach (j; i .. a.length)
+ emplaceInitializer(cast() arr[j]);
+ }
+ for (; i < a.length; i++)
+ {
+ copyEmplace(a.ptr[i], arr[i]);
+ }
+ return cast(U[])(arr[0..a.length]);
+ } ();
- return res;
+ return res;
+ }
}
// https://issues.dlang.org/show_bug.cgi?id=22107
diff --git a/libphobos/libdruntime/core/internal/array/utils.d b/libphobos/libdruntime/core/internal/array/utils.d
index 41aa57f..a16005e 100644
--- a/libphobos/libdruntime/core/internal/array/utils.d
+++ b/libphobos/libdruntime/core/internal/array/utils.d
@@ -34,76 +34,79 @@ ulong accumulatePure(string file, int line, string funcname, string name, ulong
return func(file, line, funcname, name, size);
}
-/**
- * TraceGC wrapper generator around the runtime hook `Hook`.
- * Params:
- * Type = The type of hook to report to accumulate
- * Hook = The name hook to wrap
- */
-template TraceHook(string Type, string Hook)
+version (D_ProfileGC)
{
- const char[] TraceHook = q{
- import core.internal.array.utils : gcStatsPure, accumulatePure;
-
- pragma(inline, false);
- string name = } ~ "`" ~ Type ~ "`;" ~ q{
-
- // FIXME: use rt.tracegc.accumulator when it is accessable in the future.
- version (tracegc)
- } ~ "{\n" ~ q{
- import core.stdc.stdio;
-
- printf("%sTrace file = '%.*s' line = %d function = '%.*s' type = %.*s\n",
- } ~ "\"" ~ Hook ~ "\".ptr," ~ q{
- file.length, file.ptr,
- line,
- funcname.length, funcname.ptr,
- name.length, name.ptr
- );
- } ~ "}\n" ~ q{
- ulong currentlyAllocated = gcStatsPure().allocatedInCurrentThread;
-
- scope(exit)
- {
- ulong size = gcStatsPure().allocatedInCurrentThread - currentlyAllocated;
- if (size > 0)
- if (!accumulatePure(file, line, funcname, name, size)) {
- // This 'if' and 'assert' is needed to force the compiler to not remove the call to
- // `accumulatePure`. It really want to do that while optimizing as the function is
- // `pure` and it does not influence the result of this hook.
-
- // `accumulatePure` returns the value of `size`, which can never be zero due to the
- // previous 'if'. So this assert will never be triggered.
- assert(0);
- }
- }
- };
-}
+ /**
+ * TraceGC wrapper generator around the runtime hook `Hook`.
+ * Params:
+ * Type = The type of hook to report to accumulate
+ * Hook = The name hook to wrap
+ */
+ template TraceHook(string Type, string Hook)
+ {
+ const char[] TraceHook = q{
+ import core.internal.array.utils : gcStatsPure, accumulatePure;
+
+ pragma(inline, false);
+ string name = } ~ "`" ~ Type ~ "`;" ~ q{
+
+ // FIXME: use rt.tracegc.accumulator when it is accessable in the future.
+ version (tracegc)
+ } ~ "{\n" ~ q{
+ import core.stdc.stdio;
+
+ printf("%sTrace file = '%.*s' line = %d function = '%.*s' type = %.*s\n",
+ } ~ "\"" ~ Hook ~ "\".ptr," ~ q{
+ file.length, file.ptr,
+ line,
+ funcname.length, funcname.ptr,
+ name.length, name.ptr
+ );
+ } ~ "}\n" ~ q{
+ ulong currentlyAllocated = gcStatsPure().allocatedInCurrentThread;
+
+ scope(exit)
+ {
+ ulong size = gcStatsPure().allocatedInCurrentThread - currentlyAllocated;
+ if (size > 0)
+ if (!accumulatePure(file, line, funcname, name, size)) {
+ // This 'if' and 'assert' is needed to force the compiler to not remove the call to
+ // `accumulatePure`. It really want to do that while optimizing as the function is
+ // `pure` and it does not influence the result of this hook.
+
+ // `accumulatePure` returns the value of `size`, which can never be zero due to the
+ // previous 'if'. So this assert will never be triggered.
+ assert(0);
+ }
+ }
+ };
+ }
-/**
- * TraceGC wrapper around runtime hook `Hook`.
- * Params:
- * T = Type of hook to report to accumulate
- * Hook = The hook to wrap
- * errorMessage = The error message incase `version != D_TypeInfo`
- * file = File that called `_d_HookTraceImpl`
- * line = Line inside of `file` that called `_d_HookTraceImpl`
- * funcname = Function that called `_d_HookTraceImpl`
- * parameters = Parameters that will be used to call `Hook`
- * Bugs:
- * This function template needs be between the compiler and a much older runtime hook that bypassed safety,
- * purity, and throwabilty checks. To prevent breaking existing code, this function template
- * is temporarily declared `@trusted pure` until the implementation can be brought up to modern D expectations.
-*/
-auto _d_HookTraceImpl(T, alias Hook, string errorMessage)(string file, int line, string funcname, Parameters!Hook parameters) @trusted pure
-{
- version (D_TypeInfo)
+ /**
+ * TraceGC wrapper around runtime hook `Hook`.
+ * Params:
+ * T = Type of hook to report to accumulate
+ * Hook = The hook to wrap
+ * errorMessage = The error message incase `version != D_TypeInfo`
+ * file = File that called `_d_HookTraceImpl`
+ * line = Line inside of `file` that called `_d_HookTraceImpl`
+ * funcname = Function that called `_d_HookTraceImpl`
+ * parameters = Parameters that will be used to call `Hook`
+ * Bugs:
+ * This function template needs be between the compiler and a much older runtime hook that bypassed safety,
+ * purity, and throwabilty checks. To prevent breaking existing code, this function template
+ * is temporarily declared `@trusted pure` until the implementation can be brought up to modern D expectations.
+ */
+ auto _d_HookTraceImpl(T, alias Hook, string errorMessage)(string file, int line, string funcname, Parameters!Hook parameters) @trusted pure
{
- mixin(TraceHook!(T.stringof, __traits(identifier, Hook)));
- return Hook(parameters);
+ version (D_TypeInfo)
+ {
+ mixin(TraceHook!(T.stringof, __traits(identifier, Hook)));
+ return Hook(parameters);
+ }
+ else
+ assert(0, errorMessage);
}
- else
- assert(0, errorMessage);
}
/**
diff --git a/libphobos/libdruntime/core/internal/dassert.d b/libphobos/libdruntime/core/internal/dassert.d
index 07486c2..dbad0e6 100644
--- a/libphobos/libdruntime/core/internal/dassert.d
+++ b/libphobos/libdruntime/core/internal/dassert.d
@@ -518,7 +518,7 @@ private auto assumeFakeAttributes(T)(T t) @trusted
}
/// Wrapper for `miniFormat` which assumes that the implementation is `@safe`, `@nogc`, ...
-/// s.t. it does not violate the constraints of the the function containing the `assert`.
+/// s.t. it does not violate the constraints of the function containing the `assert`.
private string miniFormatFakeAttributes(T)(const scope ref T t)
{
alias miniT = miniFormat!T;
diff --git a/libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d b/libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d
index e29e426..6d19247 100644
--- a/libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d
+++ b/libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d
@@ -110,13 +110,23 @@ alias GC gc_t;
/* ============================ GC =============================== */
// register GC in C constructor (_STI_)
-extern(C) pragma(crt_constructor) void _d_register_conservative_gc()
+private pragma(crt_constructor) void gc_conservative_ctor()
+{
+ _d_register_conservative_gc();
+}
+
+extern(C) void _d_register_conservative_gc()
{
import core.gc.registry;
registerGCFactory("conservative", &initialize);
}
-extern(C) pragma(crt_constructor) void _d_register_precise_gc()
+private pragma(crt_constructor) void gc_precise_ctor()
+{
+ _d_register_precise_gc();
+}
+
+extern(C) void _d_register_precise_gc()
{
import core.gc.registry;
registerGCFactory("precise", &initialize_precise);
diff --git a/libphobos/libdruntime/core/internal/gc/impl/manual/gc.d b/libphobos/libdruntime/core/internal/gc/impl/manual/gc.d
index a65c636..570781e 100644
--- a/libphobos/libdruntime/core/internal/gc/impl/manual/gc.d
+++ b/libphobos/libdruntime/core/internal/gc/impl/manual/gc.d
@@ -29,7 +29,12 @@ static import core.memory;
extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow @nogc; /* dmd @@@BUG11461@@@ */
// register GC in C constructor (_STI_)
-extern(C) pragma(crt_constructor) void _d_register_manual_gc()
+private pragma(crt_constructor) void gc_manual_ctor()
+{
+ _d_register_manual_gc();
+}
+
+extern(C) void _d_register_manual_gc()
{
import core.gc.registry;
registerGCFactory("manual", &initialize);
diff --git a/libphobos/libdruntime/core/internal/gc/os.d b/libphobos/libdruntime/core/internal/gc/os.d
index 64f1203..38b60cb 100644
--- a/libphobos/libdruntime/core/internal/gc/os.d
+++ b/libphobos/libdruntime/core/internal/gc/os.d
@@ -70,10 +70,7 @@ else version (Posix)
else if (errno == ECHILD)
return ChildStatus.done; // someone called posix.syswait
else if (waited_pid != pid || status != 0)
- {
onForkError();
- return ChildStatus.error;
- }
return ChildStatus.done;
}
diff --git a/libphobos/libdruntime/core/internal/traits.d b/libphobos/libdruntime/core/internal/traits.d
index 0b4890c..966839f 100644
--- a/libphobos/libdruntime/core/internal/traits.d
+++ b/libphobos/libdruntime/core/internal/traits.d
@@ -654,7 +654,7 @@ if (func.length == 1 /*&& isCallable!func*/)
int test(int);
int test() @property;
}
- alias ov = __traits(getVirtualFunctions, Overloads, "test");
+ alias ov = __traits(getVirtualMethods, Overloads, "test");
alias F_ov0 = FunctionTypeOf!(ov[0]);
alias F_ov1 = FunctionTypeOf!(ov[1]);
alias F_ov2 = FunctionTypeOf!(ov[2]);
diff --git a/libphobos/libdruntime/core/internal/utf.d b/libphobos/libdruntime/core/internal/utf.d
index 27bf7f2b..9808b99 100644
--- a/libphobos/libdruntime/core/internal/utf.d
+++ b/libphobos/libdruntime/core/internal/utf.d
@@ -567,17 +567,22 @@ ubyte codeLength(C)(dchar c)
/***********************************
Checks to see if string is well formed or not. $(D S) can be an array
- of $(D char), $(D wchar), or $(D dchar). Throws a $(D UtfException)
- if it is not. Use to check all untrusted input for correctness.
+ of $(D char), $(D wchar), or $(D dchar). Returns $(D false) if it is not.
+ Use to check all untrusted input for correctness.
*/
-@safe pure
-void validate(S)(const scope S s)
+@safe pure nothrow
+bool isValidString(S)(const scope S s)
{
auto len = s.length;
for (size_t i = 0; i < len; )
{
- decode(s, i);
+ try
+ decode(s, i);
+ catch (Exception e)
+ return false;
}
+
+ return true;
}
/* =================== Conversion to UTF8 ======================= */
@@ -626,7 +631,7 @@ char[] toUTF8(return scope char[] buf, dchar c)
string toUTF8(return scope string s)
in
{
- validate(s);
+ assert(isValidString(s));
}
do
{
@@ -787,7 +792,7 @@ wptr toUTF16z(const scope char[] s)
wstring toUTF16(return scope wstring s)
in
{
- validate(s);
+ assert(isValidString(s));
}
do
{
@@ -867,7 +872,7 @@ dstring toUTF32(const scope wchar[] s)
dstring toUTF32(return scope dstring s)
in
{
- validate(s);
+ assert(isValidString(s));
}
do
{
diff --git a/libphobos/libdruntime/core/lifetime.d b/libphobos/libdruntime/core/lifetime.d
index 371308d..5e339c0 100644
--- a/libphobos/libdruntime/core/lifetime.d
+++ b/libphobos/libdruntime/core/lifetime.d
@@ -2385,21 +2385,24 @@ template _d_delstructImpl(T)
}
}
- import core.internal.array.utils : _d_HookTraceImpl;
+ version (D_ProfileGC)
+ {
+ import core.internal.array.utils : _d_HookTraceImpl;
- private enum errorMessage = "Cannot delete struct if compiling without support for runtime type information!";
+ private enum errorMessage = "Cannot delete struct if compiling without support for runtime type information!";
- /**
- * TraceGC wrapper around $(REF _d_delstruct, core,lifetime,_d_delstructImpl).
- *
- * Bugs:
- * This function template was ported from a much older runtime hook that
- * bypassed safety, purity, and throwabilty checks. To prevent breaking
- * existing code, this function template is temporarily declared
- * `@trusted` until the implementation can be brought up to modern D
- * expectations.
- */
- alias _d_delstructTrace = _d_HookTraceImpl!(T, _d_delstruct, errorMessage);
+ /**
+ * TraceGC wrapper around $(REF _d_delstruct, core,lifetime,_d_delstructImpl).
+ *
+ * Bugs:
+ * This function template was ported from a much older runtime hook that
+ * bypassed safety, purity, and throwabilty checks. To prevent breaking
+ * existing code, this function template is temporarily declared
+ * `@trusted` until the implementation can be brought up to modern D
+ * expectations.
+ */
+ alias _d_delstructTrace = _d_HookTraceImpl!(T, _d_delstruct, errorMessage);
+ }
}
@system pure nothrow unittest
@@ -2709,3 +2712,108 @@ T _d_newThrowable(T)() @trusted
assert(exc.refcount() == 1);
assert(e.refcount() == 1);
}
+
+/**
+ * Create a new class instance.
+ * Allocates memory and sets fields to their initial value, but does not call a
+ * constructor.
+ * ---
+ * new C() // _d_newclass!(C)()
+ * ---
+ * Returns: newly created object
+ */
+T _d_newclassT(T)() @trusted
+if (is(T == class))
+{
+ import core.internal.traits : hasIndirections;
+ import core.exception : onOutOfMemoryError;
+ import core.memory : GC, pureMalloc;
+
+ alias BlkAttr = GC.BlkAttr;
+
+ auto init = __traits(initSymbol, T);
+ void* p;
+
+ static if (__traits(getLinkage, T) == "Windows")
+ {
+ p = pureMalloc(init.length);
+ if (!p)
+ onOutOfMemoryError();
+ }
+ else
+ {
+ BlkAttr attr = BlkAttr.NONE;
+
+ /* `extern(C++)`` classes don't have a classinfo pointer in their vtable,
+ * so the GC can't finalize them.
+ */
+ static if (__traits(hasMember, T, "__dtor") && __traits(getLinkage, T) != "C++")
+ attr |= BlkAttr.FINALIZE;
+ static if (!hasIndirections!T)
+ attr |= BlkAttr.NO_SCAN;
+
+ p = GC.malloc(init.length, attr, typeid(T));
+ debug(PRINTF) printf(" p = %p\n", p);
+ }
+
+ debug(PRINTF)
+ {
+ printf("p = %p\n", p);
+ printf("init.ptr = %p, len = %llu\n", init.ptr, cast(ulong)init.length);
+ printf("vptr = %p\n", *cast(void**) init);
+ printf("vtbl[0] = %p\n", (*cast(void***) init)[0]);
+ printf("vtbl[1] = %p\n", (*cast(void***) init)[1]);
+ printf("init[0] = %x\n", (cast(uint*) init)[0]);
+ printf("init[1] = %x\n", (cast(uint*) init)[1]);
+ printf("init[2] = %x\n", (cast(uint*) init)[2]);
+ printf("init[3] = %x\n", (cast(uint*) init)[3]);
+ printf("init[4] = %x\n", (cast(uint*) init)[4]);
+ }
+
+ // initialize it
+ p[0 .. init.length] = init[];
+
+ debug(PRINTF) printf("initialization done\n");
+ return cast(T) p;
+}
+
+// Test allocation
+@safe unittest
+{
+ class C { }
+ C c = _d_newclassT!C();
+
+ assert(c !is null);
+}
+
+// Test initializers
+@safe unittest
+{
+ {
+ class C { int x, y; }
+ C c = _d_newclassT!C();
+
+ assert(c.x == 0);
+ assert(c.y == 0);
+ }
+ {
+ class C { int x = 2, y = 3; }
+ C c = _d_newclassT!C();
+
+ assert(c.x == 2);
+ assert(c.y == 3);
+ }
+}
+
+T _d_newclassTTrace(T)(string file, int line, string funcname) @trusted
+{
+ version (D_TypeInfo)
+ {
+ import core.internal.array.utils: TraceHook, gcStatsPure, accumulatePure;
+ mixin(TraceHook!(T.stringof, "_d_newclassT"));
+
+ return _d_newclassT!T();
+ }
+ else
+ assert(0, "Cannot create new class if compiling without support for runtime type information!");
+}
diff --git a/libphobos/libdruntime/core/memory.d b/libphobos/libdruntime/core/memory.d
index 7d1356a..96c2af4 100644
--- a/libphobos/libdruntime/core/memory.d
+++ b/libphobos/libdruntime/core/memory.d
@@ -202,8 +202,8 @@ unittest
// make it more difficult to call the function again, manually.
private void initialize();
pragma(crt_constructor)
-pragma(mangle, `_D` ~ initialize.mangleof)
-private extern (C) void initialize() @system
+pragma(mangle, initialize.mangleof)
+private extern (C) void _initialize() @system
{
version (Posix)
{
diff --git a/libphobos/libdruntime/core/runtime.d b/libphobos/libdruntime/core/runtime.d
index 75e671c..19bb61b 100644
--- a/libphobos/libdruntime/core/runtime.d
+++ b/libphobos/libdruntime/core/runtime.d
@@ -112,7 +112,7 @@ private
alias void delegate( Throwable ) ExceptionHandler;
extern (C) void _d_print_throwable(Throwable t);
- extern (C) void* thread_stackBottom();
+ extern (C) void* thread_stackBottom() nothrow @nogc;
}
@@ -122,7 +122,7 @@ shared static this()
// still possible the app could exit without a stack trace. If
// this becomes an issue, the handler could be set in C main
// before the module ctors are run.
- Runtime.traceHandler = &defaultTraceHandler;
+ Runtime.traceHandler(&defaultTraceHandler, &defaultTraceDeallocator);
}
@@ -284,10 +284,18 @@ struct Runtime
* If the supplied pointer is null then the trace routine should determine
* an appropriate calling context from which to begin the trace.
*
+ * If the deallocator is set, then it is called with the traceinfo when the
+ * exception is finalized. The deallocator is only set in the exception if
+ * the default handler is used to generate the trace info.
+ *
* Params:
* h = The new trace handler. Set to null to disable exception backtracing.
+ * d = The new trace deallocator. If non-null, this will be called on
+ * exception destruction with the trace info, only when the trace
+ * handler is used to generate TraceInfo.
*/
- extern(C) pragma(mangle, "rt_setTraceHandler") static @property void traceHandler(TraceHandler h);
+ extern(C) pragma(mangle, "rt_setTraceHandler") static @property void traceHandler(TraceHandler h,
+ Throwable.TraceDeallocator d = null);
/**
* Gets the current trace handler.
@@ -298,6 +306,14 @@ struct Runtime
extern(C) pragma(mangle, "rt_getTraceHandler") static @property TraceHandler traceHandler();
/**
+ * Gets the current trace deallocator.
+ *
+ * Returns:
+ * The current trace deallocator or null if none has been set.
+ */
+ extern(C) pragma(mangle, "rt_getTraceDeallocator") static @property Throwable.TraceDeallocator traceDeallocator();
+
+ /**
* Overrides the default collect hander with a user-supplied version. This
* routine will be called for each resource object that is finalized in a
* non-deterministic manner--typically during a garbage collection cycle.
@@ -705,6 +721,10 @@ extern (C) UnitTestResult runModuleUnitTests()
* This functions returns a trace handler, allowing to inspect the
* current stack trace.
*
+ * IMPORTANT NOTE! the returned trace is potentially not GC allocated, and so
+ * you must call `defaultTraceDeallocator` when you are finished with the
+ * `TraceInfo`
+ *
* Params:
* ptr = (Windows only) The context to get the stack trace from.
* When `null` (the default), start from the current frame.
@@ -714,14 +734,24 @@ extern (C) UnitTestResult runModuleUnitTests()
* or `null`. If called from a finalizer (destructor), always returns `null`
* as trace handlers allocate.
*/
-Throwable.TraceInfo defaultTraceHandler( void* ptr = null )
+Throwable.TraceInfo defaultTraceHandler( void* ptr = null ) // @nogc
{
+ // NOTE: with traces now being allocated using C malloc, no need to worry
+ // about GC reentrancy. This code left commented out for reference.
+ //
// avoid recursive GC calls in finalizer, trace handlers should be made @nogc instead
- import core.memory : GC;
+ /*import core.memory : GC;
if (GC.inFinalizer)
- return null;
+ return null;*/
- static if (__traits(compiles, new LibBacktrace(0)))
+ static T allocate(T, Args...)(auto ref Args args) @nogc
+ {
+ import core.lifetime : emplace;
+ import core.stdc.stdlib : malloc;
+ auto result = cast(T)malloc(__traits(classInstanceSize, T));
+ return emplace(result, args);
+ }
+ static if (__traits(compiles, allocate!LibBacktrace(0)))
{
version (Posix)
static enum FIRSTFRAME = 4;
@@ -729,9 +759,9 @@ Throwable.TraceInfo defaultTraceHandler( void* ptr = null )
static enum FIRSTFRAME = 4;
else
static enum FIRSTFRAME = 0;
- return new LibBacktrace(FIRSTFRAME);
+ return allocate!LibBacktrace(FIRSTFRAME);
}
- else static if (__traits(compiles, new UnwindBacktrace(0)))
+ else static if (__traits(compiles, allocate!UnwindBacktrace(0)))
{
version (Posix)
static enum FIRSTFRAME = 5;
@@ -739,25 +769,25 @@ Throwable.TraceInfo defaultTraceHandler( void* ptr = null )
static enum FIRSTFRAME = 4;
else
static enum FIRSTFRAME = 0;
- return new UnwindBacktrace(FIRSTFRAME);
+ return allocate!UnwindBacktrace(FIRSTFRAME);
}
else version (Windows)
{
import core.sys.windows.stacktrace;
- static if (__traits(compiles, new StackTrace(0, null)))
+ static if (__traits(compiles, allocate!StackTrace(0, null)))
{
import core.sys.windows.winnt : CONTEXT;
version (Win64)
enum FIRSTFRAME = 4;
else version (Win32)
enum FIRSTFRAME = 0;
- return new StackTrace(FIRSTFRAME, cast(CONTEXT*)ptr);
+ return allocate!StackTrace(FIRSTFRAME, cast(CONTEXT*)ptr);
}
else
return null;
}
- else static if (__traits(compiles, new DefaultTraceInfo()))
- return new DefaultTraceInfo();
+ else static if (__traits(compiles, allocate!DefaultTraceInfo()))
+ return allocate!DefaultTraceInfo();
else
return null;
}
@@ -775,9 +805,32 @@ unittest
{
printf("%.*s\n", cast(int)line.length, line.ptr);
}
+ defaultTraceDeallocator(trace);
}
}
+/***
+ * Deallocate a traceinfo generated by deaultTraceHander.
+ *
+ * Call this function on a TraceInfo generated via `defaultTraceHandler` when
+ * you are done with it. If necessary, this cleans up any manually managed
+ * resources from the `TraceInfo`, and invalidates it. After this, the object
+ * is no longer valid.
+ *
+ * Params:
+ * info = The `TraceInfo` to deallocate. This should only be a value that
+ * was returned by `defaultTraceHandler`.
+ */
+void defaultTraceDeallocator(Throwable.TraceInfo info) nothrow
+{
+ if (info is null)
+ return;
+ auto obj = cast(Object)info;
+ destroy(obj);
+ import core.stdc.stdlib : free;
+ free(cast(void *)obj);
+}
+
version (DRuntime_Use_Libunwind)
{
import core.internal.backtrace.handler;
@@ -791,7 +844,7 @@ else static if (hasExecinfo) private class DefaultTraceInfo : Throwable.TraceInf
import core.stdc.stdlib : free;
import core.stdc.string : strlen, memchr, memmove;
- this()
+ this() @nogc
{
// it may not be 1 but it is good enough to get
// in CALL instruction address range for backtrace
@@ -805,13 +858,13 @@ else static if (hasExecinfo) private class DefaultTraceInfo : Throwable.TraceInf
elem -= CALL_INSTRUCTION_SIZE;
else // backtrace() failed, do it ourselves
{
- static void** getBasePtr()
+ static void** getBasePtr() @nogc
{
version (D_InlineAsm_X86)
- asm { naked; mov EAX, EBP; ret; }
+ asm @nogc { naked; mov EAX, EBP; ret; }
else
version (D_InlineAsm_X86_64)
- asm { naked; mov RAX, RBP; ret; }
+ asm @nogc { naked; mov RAX, RBP; ret; }
else
return null;
}
@@ -910,7 +963,7 @@ private:
{
fixbuf[0 .. symBeg] = buf[0 .. symBeg];
- auto sym = demangle(buf[symBeg .. symEnd], fixbuf[symBeg .. $]);
+ auto sym = demangle(buf[symBeg .. symEnd], fixbuf[symBeg .. $], getCXXDemangler());
if (sym.ptr !is fixbuf.ptr + symBeg)
{
diff --git a/libphobos/libdruntime/core/simd.d b/libphobos/libdruntime/core/simd.d
index f1bf59b..c2b343a 100644
--- a/libphobos/libdruntime/core/simd.d
+++ b/libphobos/libdruntime/core/simd.d
@@ -704,7 +704,7 @@ version (D_SIMD)
// store `v` to location pointed to by `d`
storeUnaligned(cast(T*)d, v);
- // check that the the data was stored correctly
+ // check that the data was stored correctly
foreach (j; 0..T.sizeof)
{
assert(ptrToV[j] == d[j]);
diff --git a/libphobos/libdruntime/core/stdc/config.d b/libphobos/libdruntime/core/stdc/config.d
index c576e99..c85682e 100644
--- a/libphobos/libdruntime/core/stdc/config.d
+++ b/libphobos/libdruntime/core/stdc/config.d
@@ -286,6 +286,22 @@ private struct _Complex(T)
{
T re;
T im;
+
+ // Helper properties.
+ pragma(inline, true)
+ {
+ static @property epsilon()() { return _Complex(T.epsilon, T.epsilon); }
+ static @property infinity()() { return _Complex(T.infinity, T.infinity); }
+ static @property max()() { return _Complex(T.max, T.max); }
+ static @property min_normal()() { return _Complex(T.min_normal, T.min_normal); }
+ static @property nan()() { return _Complex(T.nan, T.nan); }
+ static @property dig()() { return T.dig; }
+ static @property mant_dig()() { return T.mant_dig; }
+ static @property max_10_exp()() { return T.max_10_exp; }
+ static @property max_exp()() { return T.max_exp; }
+ static @property min_10_exp()() { return T.min_10_exp; }
+ static @property min_exp()() { return T.min_exp; }
+ }
}
enum __c_complex_float : _Complex!float;
@@ -296,3 +312,28 @@ alias c_complex_float = __c_complex_float;
alias c_complex_double = __c_complex_double;
alias c_complex_real = __c_complex_real;
}
+
+
+// Returns the mangled name for the 64-bit time_t versions of
+// functions affected by musl's transition to 64-bit time_t.
+// https://musl.libc.org/time64.html
+version (CRuntime_Musl)
+{
+ version (CRuntime_Musl_Pre_Time64)
+ enum muslRedirTime64 = false;
+ else
+ {
+ // time_t was defined as a C long in older Musl versions.
+ enum muslRedirTime64 = (c_long.sizeof == 4);
+ }
+}
+else
+ enum muslRedirTime64 = false;
+
+package(core) template muslRedirTime64Mangle(string name, string redirectedName)
+{
+ static if (muslRedirTime64)
+ enum muslRedirTime64Mangle = redirectedName;
+ else
+ enum muslRedirTime64Mangle = name;
+}
diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d
index 88123fb..dbe7daa 100644
--- a/libphobos/libdruntime/core/stdc/fenv.d
+++ b/libphobos/libdruntime/core/stdc/fenv.d
@@ -24,7 +24,6 @@ else version (WatchOS)
version = Darwin;
extern (C):
-@system:
nothrow:
@nogc:
@@ -483,7 +482,7 @@ else version (CRuntime_UClibc)
alias fexcept_t = ushort;
}
- else version (MIPS32)
+ else version (MIPS_Any)
{
struct fenv_t
{
diff --git a/libphobos/libdruntime/core/stdc/math.d b/libphobos/libdruntime/core/stdc/math.d
index 0393ea5..2666c95 100644
--- a/libphobos/libdruntime/core/stdc/math.d
+++ b/libphobos/libdruntime/core/stdc/math.d
@@ -106,21 +106,14 @@ else version (CRuntime_Bionic)
}
else version (CRuntime_UClibc)
{
- version (X86)
- {
- ///
- enum int FP_ILOGB0 = int.min;
- ///
- enum int FP_ILOGBNAN = int.min;
- }
- else version (X86_64)
+ version (X86_Any)
{
///
enum int FP_ILOGB0 = int.min;
///
enum int FP_ILOGBNAN = int.min;
}
- else version (MIPS32)
+ else version (MIPS_Any)
{
///
enum int FP_ILOGB0 = -int.max;
diff --git a/libphobos/libdruntime/core/stdc/signal.d b/libphobos/libdruntime/core/stdc/signal.d
index 8d5d845..13c6f9e 100644
--- a/libphobos/libdruntime/core/stdc/signal.d
+++ b/libphobos/libdruntime/core/stdc/signal.d
@@ -15,7 +15,6 @@
module core.stdc.signal;
extern (C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/stdc/stdarg.d b/libphobos/libdruntime/core/stdc/stdarg.d
index 646905e..5b79813 100644
--- a/libphobos/libdruntime/core/stdc/stdarg.d
+++ b/libphobos/libdruntime/core/stdc/stdarg.d
@@ -12,7 +12,6 @@
module core.stdc.stdarg;
-@system:
@nogc:
nothrow:
diff --git a/libphobos/libdruntime/core/stdc/stdio.d b/libphobos/libdruntime/core/stdc/stdio.d
index fc98350..ee37da1 100644
--- a/libphobos/libdruntime/core/stdc/stdio.d
+++ b/libphobos/libdruntime/core/stdc/stdio.d
@@ -49,7 +49,6 @@ private
}
extern (C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/stdc/stdlib.d b/libphobos/libdruntime/core/stdc/stdlib.d
index 920c311..0b42de8 100644
--- a/libphobos/libdruntime/core/stdc/stdlib.d
+++ b/libphobos/libdruntime/core/stdc/stdlib.d
@@ -31,7 +31,6 @@ version (CRuntime_Glibc)
else {}
extern (C):
-@system:
/* Placed outside `nothrow` and `@nogc` in order to not constrain what the callback does.
*/
diff --git a/libphobos/libdruntime/core/stdc/string.d b/libphobos/libdruntime/core/stdc/string.d
index f15ef85..3591a6d 100644
--- a/libphobos/libdruntime/core/stdc/string.d
+++ b/libphobos/libdruntime/core/stdc/string.d
@@ -30,7 +30,6 @@ else version (CRuntime_UClibc)
version = ReturnStrerrorR;
extern (C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/stdc/time.d b/libphobos/libdruntime/core/stdc/time.d
index b19c3c7..d7a5765 100644
--- a/libphobos/libdruntime/core/stdc/time.d
+++ b/libphobos/libdruntime/core/stdc/time.d
@@ -30,19 +30,25 @@ nothrow:
@nogc:
///
+pragma(mangle, muslRedirTime64Mangle!("difftime", "__difftime64"))
pure double difftime(time_t time1, time_t time0); // MT-Safe
///
+pragma(mangle, muslRedirTime64Mangle!("mktime", "__mktime64"))
@system time_t mktime(scope tm* timeptr); // @system: MT-Safe env locale
///
+pragma(mangle, muslRedirTime64Mangle!("time", "__time64"))
time_t time(scope time_t* timer);
///
@system char* asctime(const scope tm* timeptr); // @system: MT-Unsafe race:asctime locale
///
+pragma(mangle, muslRedirTime64Mangle!("ctime", "__ctime64"))
@system char* ctime(const scope time_t* timer); // @system: MT-Unsafe race:tmbuf race:asctime env locale
///
+pragma(mangle, muslRedirTime64Mangle!("gmtime", "__gmtime64"))
@system tm* gmtime(const scope time_t* timer); // @system: MT-Unsafe race:tmbuf env locale
///
+pragma(mangle, muslRedirTime64Mangle!("localtime", "__localtime64"))
@system tm* localtime(const scope time_t* timer); // @system: MT-Unsafe race:tmbuf env locale
///
@system size_t strftime(scope char* s, size_t maxsize, const scope char* format, const scope tm* timeptr); // @system: MT-Safe env locale
diff --git a/libphobos/libdruntime/core/stdc/wchar_.d b/libphobos/libdruntime/core/stdc/wchar_.d
index d087029..fe5fce4 100644
--- a/libphobos/libdruntime/core/stdc/wchar_.d
+++ b/libphobos/libdruntime/core/stdc/wchar_.d
@@ -22,7 +22,6 @@ public import core.stdc.time; // for tm
public import core.stdc.stdint; // for WCHAR_MIN, WCHAR_MAX
extern (C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/sync/condition.d b/libphobos/libdruntime/core/sync/condition.d
index 674d78d..ddd04ae 100644
--- a/libphobos/libdruntime/core/sync/condition.d
+++ b/libphobos/libdruntime/core/sync/condition.d
@@ -20,6 +20,9 @@ public import core.sync.exception;
public import core.sync.mutex;
public import core.time;
+import core.exception : AssertError, staticError;
+
+
version (Windows)
{
import core.sync.semaphore;
@@ -51,7 +54,6 @@ else
// void notifyAll();
////////////////////////////////////////////////////////////////////////////////
-
/**
* This class represents a condition variable as conceived by C.A.R. Hoare. As
* per Mesa type monitors however, "signal" has been replaced with "notify" to
@@ -74,19 +76,19 @@ class Condition
* Throws:
* SyncError on error.
*/
- this( Mutex m ) nothrow @safe
+ this( Mutex m ) nothrow @safe @nogc
{
this(m, true);
}
/// ditto
- this( shared Mutex m ) shared nothrow @safe
+ this( shared Mutex m ) shared nothrow @safe @nogc
{
this(m, true);
}
//
- private this(this Q, M)( M m, bool _unused_ ) nothrow @trusted
+ private this(this Q, M)( M m, bool _unused_ ) nothrow @trusted @nogc
if ((is(Q == Condition) && is(M == Mutex)) ||
(is(Q == shared Condition) && is(M == shared Mutex)))
{
@@ -102,12 +104,12 @@ class Condition
}
m_blockLock = cast(HANDLE_TYPE) CreateSemaphoreA( null, 1, 1, null );
if ( m_blockLock == m_blockLock.init )
- throw new SyncError( "Unable to initialize condition" );
+ throw staticError!AssertError("Unable to initialize condition", __FILE__, __LINE__);
scope(failure) CloseHandle( cast(void*) m_blockLock );
m_blockQueue = cast(HANDLE_TYPE) CreateSemaphoreA( null, 0, int.max, null );
if ( m_blockQueue == m_blockQueue.init )
- throw new SyncError( "Unable to initialize condition" );
+ throw staticError!AssertError("Unable to initialize condition", __FILE__, __LINE__);
scope(failure) CloseHandle( cast(void*) m_blockQueue );
InitializeCriticalSection( cast(RTL_CRITICAL_SECTION*) &m_unblockLock );
@@ -123,29 +125,28 @@ class Condition
pthread_condattr_t attr = void;
int rc = pthread_condattr_init( &attr );
if ( rc )
- throw new SyncError( "Unable to initialize condition" );
+ throw staticError!AssertError("Unable to initialize condition", __FILE__, __LINE__);
rc = pthread_condattr_setclock( &attr, CLOCK_MONOTONIC );
if ( rc )
- throw new SyncError( "Unable to initialize condition" );
+ throw staticError!AssertError("Unable to initialize condition", __FILE__, __LINE__);
rc = pthread_cond_init( cast(pthread_cond_t*) &m_hndl, &attr );
if ( rc )
- throw new SyncError( "Unable to initialize condition" );
+ throw staticError!AssertError("Unable to initialize condition", __FILE__, __LINE__);
rc = pthread_condattr_destroy( &attr );
if ( rc )
- throw new SyncError( "Unable to initialize condition" );
+ throw staticError!AssertError("Unable to initialize condition", __FILE__, __LINE__);
} ();
}
else
{
int rc = pthread_cond_init( cast(pthread_cond_t*) &m_hndl, null );
if ( rc )
- throw new SyncError( "Unable to initialize condition" );
+ throw staticError!AssertError("Unable to initialize condition", __FILE__, __LINE__);
}
}
}
-
- ~this()
+ ~this() @nogc
{
version (Windows)
{
@@ -231,7 +232,7 @@ class Condition
{
int rc = pthread_cond_wait( cast(pthread_cond_t*) &m_hndl, (cast(Mutex) m_assocMutex).handleAddr() );
if ( rc )
- throw new SyncError( "Unable to wait for condition" );
+ throw staticError!AssertError("Unable to wait for condition", __FILE__, __LINE__);
}
}
@@ -296,7 +297,7 @@ class Condition
return true;
if ( rc == ETIMEDOUT )
return false;
- throw new SyncError( "Unable to wait for condition" );
+ throw staticError!AssertError("Unable to wait for condition", __FILE__, __LINE__);
}
}
@@ -344,7 +345,7 @@ class Condition
rc = pthread_cond_signal( cast(pthread_cond_t*) &m_hndl );
} while ( rc == EAGAIN );
if ( rc )
- throw new SyncError( "Unable to notify condition" );
+ throw staticError!AssertError("Unable to notify condition", __FILE__, __LINE__);
}
}
@@ -392,7 +393,7 @@ class Condition
rc = pthread_cond_broadcast( cast(pthread_cond_t*) &m_hndl );
} while ( rc == EAGAIN );
if ( rc )
- throw new SyncError( "Unable to notify condition" );
+ throw staticError!AssertError("Unable to notify condition", __FILE__, __LINE__);
}
}
diff --git a/libphobos/libdruntime/core/sync/mutex.d b/libphobos/libdruntime/core/sync/mutex.d
index b848a14..e7380c46 100644
--- a/libphobos/libdruntime/core/sync/mutex.d
+++ b/libphobos/libdruntime/core/sync/mutex.d
@@ -292,7 +292,7 @@ private:
package:
version (Posix)
{
- pthread_mutex_t* handleAddr()
+ pthread_mutex_t* handleAddr() @nogc
{
return &m_hndl;
}
diff --git a/libphobos/libdruntime/core/sys/darwin/fcntl.d b/libphobos/libdruntime/core/sys/darwin/fcntl.d
index 47d895a..413d9c6 100644
--- a/libphobos/libdruntime/core/sys/darwin/fcntl.d
+++ b/libphobos/libdruntime/core/sys/darwin/fcntl.d
@@ -15,6 +15,5 @@ version (Darwin):
extern (C):
nothrow:
@nogc:
-@system:
enum F_FULLFSYNC = 51;
diff --git a/libphobos/libdruntime/core/sys/darwin/ifaddrs.d b/libphobos/libdruntime/core/sys/darwin/ifaddrs.d
index a254036..2e744b0 100644
--- a/libphobos/libdruntime/core/sys/darwin/ifaddrs.d
+++ b/libphobos/libdruntime/core/sys/darwin/ifaddrs.d
@@ -29,7 +29,6 @@ version (Darwin):
extern (C):
nothrow:
@nogc:
-@system:
import core.sys.posix.sys.socket;
diff --git a/libphobos/libdruntime/core/sys/darwin/mach/getsect.d b/libphobos/libdruntime/core/sys/darwin/mach/getsect.d
index dc42a2d..b6e10a8 100644
--- a/libphobos/libdruntime/core/sys/darwin/mach/getsect.d
+++ b/libphobos/libdruntime/core/sys/darwin/mach/getsect.d
@@ -148,7 +148,7 @@ version (CoreDdoc)
*
* auto mph = _NSGetMachExecuteHeader();
* int size;
- * assert(getsectdata(mph, "__TEXT", "__text", &size));
+ * assert(getsectiondata(mph, "__TEXT", "__text", &size));
* assert(size > 0);
* }
* ---
diff --git a/libphobos/libdruntime/core/sys/darwin/mach/loader.d b/libphobos/libdruntime/core/sys/darwin/mach/loader.d
index f46698c..7713eea 100644
--- a/libphobos/libdruntime/core/sys/darwin/mach/loader.d
+++ b/libphobos/libdruntime/core/sys/darwin/mach/loader.d
@@ -1803,7 +1803,7 @@ version (CoreDdoc)
* image. The isub_image field is an index into the sub-images
* (sub-frameworks and sub-umbrellas list) that made up the two-level image
* that the undefined symbol was found in when it was built by the static
- * link editor. If isub-image is 0 the the symbol is expected to be defined
+ * link editor. If isub-image is 0 the symbol is expected to be defined
* in library and not in the sub-images. If isub-image is non-zero it is an
* index into the array of sub-images for the umbrella with the first index
* in the sub-images being 1. The array of sub-images is the ordered list of
diff --git a/libphobos/libdruntime/core/sys/darwin/sys/event.d b/libphobos/libdruntime/core/sys/darwin/sys/event.d
index 24f1cbe..53504db 100644
--- a/libphobos/libdruntime/core/sys/darwin/sys/event.d
+++ b/libphobos/libdruntime/core/sys/darwin/sys/event.d
@@ -46,12 +46,12 @@ enum : short
EVFILT_EXCEPT = -15,
}
-extern(D) void EV_SET(kevent_t* kevp, typeof(kevent_t.tupleof) args)
+extern(D) void EV_SET()(kevent_t* kevp, typeof(kevent_t.tupleof) args)
{
*kevp = kevent_t(args);
}
-extern(D) void EV_SET64(kevent64_s* kevp, typeof(kevent64_s.tupleof) args)
+extern(D) void EV_SET64()(kevent64_s* kevp, typeof(kevent64_s.tupleof) args)
{
*kevp = kevent64_s(args);
}
diff --git a/libphobos/libdruntime/core/sys/elf/package.d b/libphobos/libdruntime/core/sys/elf/package.d
index 2dcfd20..b120ee5 100644
--- a/libphobos/libdruntime/core/sys/elf/package.d
+++ b/libphobos/libdruntime/core/sys/elf/package.d
@@ -8,7 +8,6 @@ module core.sys.elf;
extern (C):
pure:
nothrow:
-@system:
import core.stdc.stdint;
diff --git a/libphobos/libdruntime/core/sys/freebsd/config.d b/libphobos/libdruntime/core/sys/freebsd/config.d
index 5e3129e..9d502e5 100644
--- a/libphobos/libdruntime/core/sys/freebsd/config.d
+++ b/libphobos/libdruntime/core/sys/freebsd/config.d
@@ -14,8 +14,9 @@ public import core.sys.posix.config;
// NOTE: When adding newer versions of FreeBSD, verify all current versioned
// bindings are still compatible with the release.
- version (FreeBSD_13) enum __FreeBSD_version = 1300000;
-else version (FreeBSD_12) enum __FreeBSD_version = 1202000;
+ version (FreeBSD_14) enum __FreeBSD_version = 1400000;
+else version (FreeBSD_13) enum __FreeBSD_version = 1301000;
+else version (FreeBSD_12) enum __FreeBSD_version = 1203000;
else version (FreeBSD_11) enum __FreeBSD_version = 1104000;
else version (FreeBSD_10) enum __FreeBSD_version = 1004000;
else version (FreeBSD_9) enum __FreeBSD_version = 903000;
diff --git a/libphobos/libdruntime/core/sys/linux/dlfcn.d b/libphobos/libdruntime/core/sys/linux/dlfcn.d
index fbb8462..a13bae7 100644
--- a/libphobos/libdruntime/core/sys/linux/dlfcn.d
+++ b/libphobos/libdruntime/core/sys/linux/dlfcn.d
@@ -9,7 +9,6 @@ version (linux):
extern (C):
nothrow:
@nogc:
-@system:
version (ARM) version = ARM_Any;
version (AArch64) version = ARM_Any;
diff --git a/libphobos/libdruntime/core/sys/linux/elf.d b/libphobos/libdruntime/core/sys/linux/elf.d
index 168b936..0486cbe 100644
--- a/libphobos/libdruntime/core/sys/linux/elf.d
+++ b/libphobos/libdruntime/core/sys/linux/elf.d
@@ -9,7 +9,6 @@ version (linux):
extern (C):
pure:
nothrow:
-@system:
import core.stdc.stdint;
public import core.sys.elf;
diff --git a/libphobos/libdruntime/core/sys/linux/epoll.d b/libphobos/libdruntime/core/sys/linux/epoll.d
index f5ff7db..99099b5 100644
--- a/libphobos/libdruntime/core/sys/linux/epoll.d
+++ b/libphobos/libdruntime/core/sys/linux/epoll.d
@@ -13,10 +13,8 @@ version (linux):
import core.sys.posix.signal : sigset_t;
extern (C):
-@system:
@nogc:
nothrow:
-@system:
version (ARM) version = ARM_Any;
version (AArch64) version = ARM_Any;
diff --git a/libphobos/libdruntime/core/sys/linux/err.d b/libphobos/libdruntime/core/sys/linux/err.d
index be5378d..c3752de 100644
--- a/libphobos/libdruntime/core/sys/linux/err.d
+++ b/libphobos/libdruntime/core/sys/linux/err.d
@@ -12,7 +12,6 @@ version (linux):
extern (C):
nothrow:
@nogc:
-@system:
void err(int eval, scope const char* fmt, ...);
void errx(int eval, scope const char* fmt, ...);
diff --git a/libphobos/libdruntime/core/sys/linux/errno.d b/libphobos/libdruntime/core/sys/linux/errno.d
index d7a39ac..74844e7 100644
--- a/libphobos/libdruntime/core/sys/linux/errno.d
+++ b/libphobos/libdruntime/core/sys/linux/errno.d
@@ -8,7 +8,6 @@ module core.sys.linux.errno;
version (linux):
extern (C):
nothrow:
-@system:
public import core.stdc.errno;
import core.sys.linux.config;
diff --git a/libphobos/libdruntime/core/sys/linux/execinfo.d b/libphobos/libdruntime/core/sys/linux/execinfo.d
index 4169ca3..50dc60d 100644
--- a/libphobos/libdruntime/core/sys/linux/execinfo.d
+++ b/libphobos/libdruntime/core/sys/linux/execinfo.d
@@ -10,7 +10,6 @@ module core.sys.linux.execinfo;
version (linux):
extern (C):
nothrow:
-@system:
@nogc:
int backtrace(void** buffer, int size);
diff --git a/libphobos/libdruntime/core/sys/linux/fcntl.d b/libphobos/libdruntime/core/sys/linux/fcntl.d
index 11c3745..d666efe 100644
--- a/libphobos/libdruntime/core/sys/linux/fcntl.d
+++ b/libphobos/libdruntime/core/sys/linux/fcntl.d
@@ -5,7 +5,6 @@ public import core.sys.posix.fcntl;
version (linux):
extern(C):
nothrow:
-@system:
// From linux/falloc.h
/// fallocate(2) params
@@ -42,7 +41,7 @@ These cmd values will set locks that conflict with process-associated
record locks, but are "owned" by the open file description, not the
process. This means that they are inherited across fork() like BSD (flock)
locks, and they are only released automatically when the last reference to
-the the open file against which they were acquired is put.
+the open file against which they were acquired is put.
*/
enum
diff --git a/libphobos/libdruntime/core/sys/linux/fs.d b/libphobos/libdruntime/core/sys/linux/fs.d
index c5525066..ca88567 100644
--- a/libphobos/libdruntime/core/sys/linux/fs.d
+++ b/libphobos/libdruntime/core/sys/linux/fs.d
@@ -18,7 +18,6 @@ public import core.sys.posix.sys.ioctl;
import core.stdc.config : c_ulong, c_long;
extern (C):
-@system:
@nogc:
nothrow:
diff --git a/libphobos/libdruntime/core/sys/linux/ifaddrs.d b/libphobos/libdruntime/core/sys/linux/ifaddrs.d
index 5490e97a..479dfa8 100644
--- a/libphobos/libdruntime/core/sys/linux/ifaddrs.d
+++ b/libphobos/libdruntime/core/sys/linux/ifaddrs.d
@@ -22,7 +22,6 @@ version (linux):
extern (C):
nothrow:
@nogc:
-@system:
struct ifaddrs
{
diff --git a/libphobos/libdruntime/core/sys/linux/io_uring.d b/libphobos/libdruntime/core/sys/linux/io_uring.d
index 5e1a20c..7bafb9f 100644
--- a/libphobos/libdruntime/core/sys/linux/io_uring.d
+++ b/libphobos/libdruntime/core/sys/linux/io_uring.d
@@ -14,10 +14,8 @@ version (linux):
import core.sys.linux.fs : __kernel_rwf_t;
extern (C):
-@system:
@nogc:
nothrow:
-@system:
/**
* IO submission data structure (Submission Queue Entry)
diff --git a/libphobos/libdruntime/core/sys/linux/link.d b/libphobos/libdruntime/core/sys/linux/link.d
index b417ec8..4d7eb1e 100644
--- a/libphobos/libdruntime/core/sys/linux/link.d
+++ b/libphobos/libdruntime/core/sys/linux/link.d
@@ -8,7 +8,6 @@ module core.sys.linux.link;
version (linux):
extern (C):
nothrow:
-@system:
version (ARM) version = ARM_Any;
version (AArch64) version = ARM_Any;
diff --git a/libphobos/libdruntime/core/sys/linux/perf_event.d b/libphobos/libdruntime/core/sys/linux/perf_event.d
index 9e96a7f..b9993a7 100644
--- a/libphobos/libdruntime/core/sys/linux/perf_event.d
+++ b/libphobos/libdruntime/core/sys/linux/perf_event.d
@@ -9,7 +9,6 @@ module core.sys.linux.perf_event;
version (linux) : extern (C):
@nogc:
nothrow:
-@system:
import core.sys.posix.sys.ioctl;
import core.sys.posix.unistd;
diff --git a/libphobos/libdruntime/core/sys/linux/sched.d b/libphobos/libdruntime/core/sys/linux/sched.d
index e828b74..5cd512e 100644
--- a/libphobos/libdruntime/core/sys/linux/sched.d
+++ b/libphobos/libdruntime/core/sys/linux/sched.d
@@ -26,7 +26,6 @@ version (linux):
extern (C):
@nogc:
nothrow:
-@system:
private // helpers
diff --git a/libphobos/libdruntime/core/sys/linux/stdio.d b/libphobos/libdruntime/core/sys/linux/stdio.d
index ab8971b..2d079fd 100644
--- a/libphobos/libdruntime/core/sys/linux/stdio.d
+++ b/libphobos/libdruntime/core/sys/linux/stdio.d
@@ -13,7 +13,6 @@ import core.sys.linux.config : __USE_FILE_OFFSET64;
import core.stdc.stdio : FILE;
import core.stdc.stddef : wchar_t;
-@system:
extern(C) nothrow
{
@@ -29,7 +28,7 @@ extern(C) nothrow
cookie_seek_function_t seek;
cookie_close_function_t close;
}
- FILE* fopencookie(in void* cookie, in char* mode, cookie_io_functions_t io_funcs);
+ FILE* fopencookie(void* cookie, const(char)* mode, cookie_io_functions_t io_funcs);
void setbuffer(FILE *stream, char *buf, size_t size); // note: _DEFAULT_SOURCE
}
diff --git a/libphobos/libdruntime/core/sys/linux/string.d b/libphobos/libdruntime/core/sys/linux/string.d
index 880faa4..a8da398 100644
--- a/libphobos/libdruntime/core/sys/linux/string.d
+++ b/libphobos/libdruntime/core/sys/linux/string.d
@@ -14,7 +14,6 @@ version (linux):
extern (C):
nothrow:
@nogc:
-@system:
static if (_GNU_SOURCE)
{
diff --git a/libphobos/libdruntime/core/sys/linux/sys/eventfd.d b/libphobos/libdruntime/core/sys/linux/sys/eventfd.d
index 0954b3f..a35d714 100644
--- a/libphobos/libdruntime/core/sys/linux/sys/eventfd.d
+++ b/libphobos/libdruntime/core/sys/linux/sys/eventfd.d
@@ -9,7 +9,6 @@ module core.sys.linux.sys.eventfd;
version (linux):
extern (C):
@nogc:
-@system:
nothrow:
version (ARM) version = ARM_Any;
diff --git a/libphobos/libdruntime/core/sys/linux/sys/inotify.d b/libphobos/libdruntime/core/sys/linux/sys/inotify.d
index 11bdc85..c74aaa6 100644
--- a/libphobos/libdruntime/core/sys/linux/sys/inotify.d
+++ b/libphobos/libdruntime/core/sys/linux/sys/inotify.d
@@ -22,7 +22,6 @@ version (DragonFlyBSD) version = LinuxOrCompatible;
version (LinuxOrCompatible):
extern (C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/sys/linux/sys/mman.d b/libphobos/libdruntime/core/sys/linux/sys/mman.d
index 649e2af..43a1aec 100644
--- a/libphobos/libdruntime/core/sys/linux/sys/mman.d
+++ b/libphobos/libdruntime/core/sys/linux/sys/mman.d
@@ -8,7 +8,6 @@ module core.sys.linux.sys.mman;
version (linux):
extern (C):
nothrow:
-@system:
@nogc:
version (ARM) version = ARM_Any;
diff --git a/libphobos/libdruntime/core/sys/linux/sys/prctl.d b/libphobos/libdruntime/core/sys/linux/sys/prctl.d
index a732216..363e1e3 100644
--- a/libphobos/libdruntime/core/sys/linux/sys/prctl.d
+++ b/libphobos/libdruntime/core/sys/linux/sys/prctl.d
@@ -8,7 +8,6 @@ module core.sys.linux.sys.prctl;
version (linux):
extern (C):
-@system:
@nogc:
nothrow:
diff --git a/libphobos/libdruntime/core/sys/linux/sys/signalfd.d b/libphobos/libdruntime/core/sys/linux/sys/signalfd.d
index 736b145..8834be4 100644
--- a/libphobos/libdruntime/core/sys/linux/sys/signalfd.d
+++ b/libphobos/libdruntime/core/sys/linux/sys/signalfd.d
@@ -12,7 +12,6 @@ import core.sys.posix.signal;
version (linux):
extern (C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/sys/linux/sys/sysinfo.d b/libphobos/libdruntime/core/sys/linux/sys/sysinfo.d
index 0c9ed59..699cd3e 100644
--- a/libphobos/libdruntime/core/sys/linux/sys/sysinfo.d
+++ b/libphobos/libdruntime/core/sys/linux/sys/sysinfo.d
@@ -7,7 +7,6 @@
module core.sys.linux.sys.sysinfo;
version (linux) extern(C) @nogc nothrow:
-@system:
import core.sys.linux.config;
diff --git a/libphobos/libdruntime/core/sys/linux/sys/xattr.d b/libphobos/libdruntime/core/sys/linux/sys/xattr.d
index 6446ff8..8618fc9 100644
--- a/libphobos/libdruntime/core/sys/linux/sys/xattr.d
+++ b/libphobos/libdruntime/core/sys/linux/sys/xattr.d
@@ -11,7 +11,6 @@ import core.sys.posix.sys.types;
version (linux):
extern (C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/sys/linux/timerfd.d b/libphobos/libdruntime/core/sys/linux/timerfd.d
index f8a9719..eacc448 100644
--- a/libphobos/libdruntime/core/sys/linux/timerfd.d
+++ b/libphobos/libdruntime/core/sys/linux/timerfd.d
@@ -11,7 +11,6 @@ version (linux):
public import core.sys.posix.time;
extern (C):
-@system:
@nogc:
nothrow:
diff --git a/libphobos/libdruntime/core/sys/linux/tipc.d b/libphobos/libdruntime/core/sys/linux/tipc.d
index 4d5d886..50f90ee 100644
--- a/libphobos/libdruntime/core/sys/linux/tipc.d
+++ b/libphobos/libdruntime/core/sys/linux/tipc.d
@@ -10,7 +10,6 @@ module core.sys.linux.tipc;
version (linux):
extern (C) nothrow @nogc:
-@system:
struct tipc_portid
{
diff --git a/libphobos/libdruntime/core/sys/linux/unistd.d b/libphobos/libdruntime/core/sys/linux/unistd.d
index 4845746..faa226c 100644
--- a/libphobos/libdruntime/core/sys/linux/unistd.d
+++ b/libphobos/libdruntime/core/sys/linux/unistd.d
@@ -5,7 +5,6 @@ public import core.sys.posix.unistd;
version (linux):
extern(C):
nothrow:
-@system:
// Additional seek constants for sparse file handling
// from Linux's unistd.h, stdio.h, and linux/fs.h
diff --git a/libphobos/libdruntime/core/sys/openbsd/sys/mman.d b/libphobos/libdruntime/core/sys/openbsd/sys/mman.d
index 7654834..8a8542a 100644
--- a/libphobos/libdruntime/core/sys/openbsd/sys/mman.d
+++ b/libphobos/libdruntime/core/sys/openbsd/sys/mman.d
@@ -47,5 +47,6 @@ static if (__BSD_VISIBLE)
int madvise(void *, size_t, int);
int minherit(void *, size_t, int);
+ int mimmutable(void *, size_t);
void* mquery(void *, size_t, int, int, int, off_t);
}
diff --git a/libphobos/libdruntime/core/sys/posix/aio.d b/libphobos/libdruntime/core/sys/posix/aio.d
index a76846e..3a537a4 100644
--- a/libphobos/libdruntime/core/sys/posix/aio.d
+++ b/libphobos/libdruntime/core/sys/posix/aio.d
@@ -8,6 +8,7 @@
*/
module core.sys.posix.aio;
+import core.stdc.config;
import core.sys.posix.signal;
import core.sys.posix.sys.types;
@@ -23,7 +24,6 @@ else version (WatchOS)
version (Posix):
extern (C):
-@system:
@nogc:
nothrow:
@@ -393,6 +393,7 @@ else
int aio_fsync(int op, aiocb* aiocbp);
int aio_error(const(aiocb)* aiocbp);
ssize_t aio_return(aiocb* aiocbp);
+ pragma(mangle, muslRedirTime64Mangle!("aio_suspend", "__aio_suspend_time64"))
int aio_suspend(const(aiocb*)* aiocb_list, int nitems, const(timespec)* timeout);
int aio_cancel(int fd, aiocb* aiocbp);
int lio_listio(int mode, const(aiocb*)* aiocb_list, int nitems, sigevent* sevp);
diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d
index 7bd0722..ae6752f2 100644
--- a/libphobos/libdruntime/core/sys/posix/config.d
+++ b/libphobos/libdruntime/core/sys/posix/config.d
@@ -19,7 +19,6 @@ public import core.stdc.config;
version (Posix):
extern (C) nothrow @nogc:
-@system:
enum _XOPEN_SOURCE = 600;
enum _POSIX_SOURCE = true;
diff --git a/libphobos/libdruntime/core/sys/posix/dirent.d b/libphobos/libdruntime/core/sys/posix/dirent.d
index bffbc51..c7e8649 100644
--- a/libphobos/libdruntime/core/sys/posix/dirent.d
+++ b/libphobos/libdruntime/core/sys/posix/dirent.d
@@ -31,7 +31,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/dlfcn.d b/libphobos/libdruntime/core/sys/posix/dlfcn.d
index a9519ca..f4bd2d8 100644
--- a/libphobos/libdruntime/core/sys/posix/dlfcn.d
+++ b/libphobos/libdruntime/core/sys/posix/dlfcn.d
@@ -45,7 +45,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// XOpen (XSI)
@@ -178,6 +177,38 @@ version (CRuntime_Glibc)
void* dli_saddr;
}
}
+else
+version (CRuntime_Musl)
+{
+ enum RTLD_LAZY = 1;
+ enum RTLD_NOW = 2;
+ enum RTLD_NOLOAD = 4;
+ enum RTLD_NODELETE = 4096;
+ enum RTLD_GLOBAL = 256;
+ enum RTLD_LOCAL = 0;
+
+ enum RTLD_NEXT = cast(void *)-1;
+ enum RTLD_DEFAULT = cast(void *)0;
+
+ enum RTLD_DI_LINKMAP = 2;
+
+ int dlclose(void *);
+ char *dlerror();
+ void *dlopen(const(char) *, int);
+
+ pragma(mangle, muslRedirTime64Mangle!("dlsym", "__dlsym_time64"))
+ void *dlsym(void *__restrict, const(char) *__restrict);
+
+ struct Dl_info
+ {
+ const(char)* dli_fname;
+ void* dli_fbase;
+ const(char)* dli_sname;
+ void* dli_saddr;
+ }
+ int dladdr(const(void) *, Dl_info *);
+ int dlinfo(void *, int, void *);
+}
else version (Darwin)
{
enum RTLD_LAZY = 0x00001;
@@ -377,7 +408,7 @@ else version (CRuntime_Musl)
}
else version (CRuntime_UClibc)
{
- version (X86_64)
+ version (X86_Any)
{
enum RTLD_LAZY = 0x0001;
enum RTLD_NOW = 0x0002;
@@ -387,7 +418,7 @@ else version (CRuntime_UClibc)
enum RTLD_LOCAL = 0;
enum RTLD_NODELETE = 0x01000;
}
- else version (MIPS32)
+ else version (MIPS_Any)
{
enum RTLD_LAZY = 0x0001;
enum RTLD_NOW = 0x0002;
diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
index dc0a183..0a58034 100644
--- a/libphobos/libdruntime/core/sys/posix/fcntl.d
+++ b/libphobos/libdruntime/core/sys/posix/fcntl.d
@@ -49,7 +49,6 @@ extern (C):
nothrow:
@nogc:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/grp.d b/libphobos/libdruntime/core/sys/posix/grp.d
index 92dcf34..3a9b993 100644
--- a/libphobos/libdruntime/core/sys/posix/grp.d
+++ b/libphobos/libdruntime/core/sys/posix/grp.d
@@ -30,7 +30,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/iconv.d b/libphobos/libdruntime/core/sys/posix/iconv.d
index cea8987..e588fb8 100644
--- a/libphobos/libdruntime/core/sys/posix/iconv.d
+++ b/libphobos/libdruntime/core/sys/posix/iconv.d
@@ -34,7 +34,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
alias void* iconv_t;
diff --git a/libphobos/libdruntime/core/sys/posix/inttypes.d b/libphobos/libdruntime/core/sys/posix/inttypes.d
index 4bde28f..e0a4473 100644
--- a/libphobos/libdruntime/core/sys/posix/inttypes.d
+++ b/libphobos/libdruntime/core/sys/posix/inttypes.d
@@ -19,7 +19,6 @@ public import core.stdc.inttypes;
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/libgen.d b/libphobos/libdruntime/core/sys/posix/libgen.d
index b90765f..6770cd8 100644
--- a/libphobos/libdruntime/core/sys/posix/libgen.d
+++ b/libphobos/libdruntime/core/sys/posix/libgen.d
@@ -15,7 +15,6 @@
module core.sys.posix.libgen;
@nogc nothrow:
-@system:
extern (C):
version (Posix):
diff --git a/libphobos/libdruntime/core/sys/posix/locale.d b/libphobos/libdruntime/core/sys/posix/locale.d
index 85e2fb6..0864f7c 100644
--- a/libphobos/libdruntime/core/sys/posix/locale.d
+++ b/libphobos/libdruntime/core/sys/posix/locale.d
@@ -12,7 +12,6 @@ module core.sys.posix.locale;
version (Posix):
extern(C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/sys/posix/mqueue.d b/libphobos/libdruntime/core/sys/posix/mqueue.d
index 2f1a8c6..eae50d2 100644
--- a/libphobos/libdruntime/core/sys/posix/mqueue.d
+++ b/libphobos/libdruntime/core/sys/posix/mqueue.d
@@ -31,7 +31,6 @@ version (Posix):
version (CRuntime_Glibc):
extern (C):
@nogc nothrow:
-@system:
/// Message queue descriptor.
@@ -147,7 +146,7 @@ int mq_notify (mqd_t mqdes, const(sigevent)* notification);
/**
- * Receive the oldest message with the highest priority the the message queue
+ * Receive the oldest message with the highest priority the message queue
*
* Params:
* mqdes = Message queue descriptor.
@@ -164,7 +163,7 @@ ssize_t mq_receive (mqd_t mqdes, char* msg_ptr, size_t msg_len, uint* msg_prio);
/**
- * Receive the oldest message with the highest priority the the message queue,
+ * Receive the oldest message with the highest priority the message queue,
* wait up to a certain timeout.
*
* Params:
@@ -179,6 +178,7 @@ ssize_t mq_receive (mqd_t mqdes, char* msg_ptr, size_t msg_len, uint* msg_prio);
* On success, mq_receive() returns the number of bytes in the received
* message; on error, -1 is returned, with errno set to indicate the error
*/
+pragma(mangle, muslRedirTime64Mangle!("mq_timedreceive", "__mq_timedreceive_time64"))
ssize_t mq_timedreceive (mqd_t mqdes, char* msg_ptr, size_t msg_len,
uint* msg_prio, const(timespec)* abs_timeout);
@@ -217,5 +217,6 @@ int mq_send (mqd_t mqdes, const(char)* msg_ptr, size_t msg_len, uint msg_prio);
* with errno set to indicate the error.
*
*/
+pragma(mangle, muslRedirTime64Mangle!("mq_timedsend", "__mq_timedsend_time64"))
int mq_timedsend (mqd_t mqdes, const(char)* msg_ptr, size_t msg_len,
uint msg_prio, const(timespec)* abs_timeout);
diff --git a/libphobos/libdruntime/core/sys/posix/netdb.d b/libphobos/libdruntime/core/sys/posix/netdb.d
index d1411ea..70a5fe1 100644
--- a/libphobos/libdruntime/core/sys/posix/netdb.d
+++ b/libphobos/libdruntime/core/sys/posix/netdb.d
@@ -33,7 +33,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/netinet/in_.d b/libphobos/libdruntime/core/sys/posix/netinet/in_.d
index a58fa85..5818ee6 100644
--- a/libphobos/libdruntime/core/sys/posix/netinet/in_.d
+++ b/libphobos/libdruntime/core/sys/posix/netinet/in_.d
@@ -547,7 +547,7 @@ version (CRuntime_Glibc)
}
// macros
- extern (D) int IN6_IS_ADDR_UNSPECIFIED( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_UNSPECIFIED( const scope in6_addr* addr ) pure
{
return (cast(uint32_t*) addr)[0] == 0 &&
(cast(uint32_t*) addr)[1] == 0 &&
@@ -555,7 +555,7 @@ version (CRuntime_Glibc)
(cast(uint32_t*) addr)[3] == 0;
}
- extern (D) int IN6_IS_ADDR_LOOPBACK( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_LOOPBACK( const scope in6_addr* addr ) pure
{
return (cast(uint32_t*) addr)[0] == 0 &&
(cast(uint32_t*) addr)[1] == 0 &&
@@ -563,29 +563,29 @@ version (CRuntime_Glibc)
(cast(uint32_t*) addr)[3] == htonl( 1 );
}
- extern (D) int IN6_IS_ADDR_MULTICAST( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MULTICAST( const scope in6_addr* addr ) pure
{
return (cast(uint8_t*) addr)[0] == 0xff;
}
- extern (D) int IN6_IS_ADDR_LINKLOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_LINKLOCAL( const scope in6_addr* addr ) pure
{
return ((cast(uint32_t*) addr)[0] & htonl( 0xffc00000 )) == htonl( 0xfe800000 );
}
- extern (D) int IN6_IS_ADDR_SITELOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_SITELOCAL( const scope in6_addr* addr ) pure
{
return ((cast(uint32_t*) addr)[0] & htonl( 0xffc00000 )) == htonl( 0xfec00000 );
}
- extern (D) int IN6_IS_ADDR_V4MAPPED( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_V4MAPPED( const scope in6_addr* addr ) pure
{
return (cast(uint32_t*) addr)[0] == 0 &&
(cast(uint32_t*) addr)[1] == 0 &&
(cast(uint32_t*) addr)[2] == htonl( 0xffff );
}
- extern (D) int IN6_IS_ADDR_V4COMPAT( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_V4COMPAT( const scope in6_addr* addr ) pure
{
return (cast(uint32_t*) addr)[0] == 0 &&
(cast(uint32_t*) addr)[1] == 0 &&
@@ -593,31 +593,31 @@ version (CRuntime_Glibc)
ntohl( (cast(uint32_t*) addr)[3] ) > 1;
}
- extern (D) int IN6_IS_ADDR_MC_NODELOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_NODELOCAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST( addr ) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0x1;
}
- extern (D) int IN6_IS_ADDR_MC_LINKLOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_LINKLOCAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST( addr ) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0x2;
}
- extern (D) int IN6_IS_ADDR_MC_SITELOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_SITELOCAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST(addr) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0x5;
}
- extern (D) int IN6_IS_ADDR_MC_ORGLOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_ORGLOCAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST( addr) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0x8;
}
- extern (D) int IN6_IS_ADDR_MC_GLOBAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_GLOBAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST( addr ) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0xe;
@@ -670,7 +670,7 @@ else version (Darwin)
}
// macros
- extern (D) int IN6_IS_ADDR_UNSPECIFIED( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_UNSPECIFIED( const scope in6_addr* addr ) pure
{
return (cast(uint32_t*) addr)[0] == 0 &&
(cast(uint32_t*) addr)[1] == 0 &&
@@ -678,7 +678,7 @@ else version (Darwin)
(cast(uint32_t*) addr)[3] == 0;
}
- extern (D) int IN6_IS_ADDR_LOOPBACK( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_LOOPBACK( const scope in6_addr* addr ) pure
{
return (cast(uint32_t*) addr)[0] == 0 &&
(cast(uint32_t*) addr)[1] == 0 &&
@@ -686,29 +686,29 @@ else version (Darwin)
(cast(uint32_t*) addr)[3] == ntohl( 1 );
}
- extern (D) int IN6_IS_ADDR_MULTICAST( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MULTICAST( const scope in6_addr* addr ) pure
{
return addr.s6_addr[0] == 0xff;
}
- extern (D) int IN6_IS_ADDR_LINKLOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_LINKLOCAL( const scope in6_addr* addr ) pure
{
return addr.s6_addr[0] == 0xfe && (addr.s6_addr[1] & 0xc0) == 0x80;
}
- extern (D) int IN6_IS_ADDR_SITELOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_SITELOCAL( const scope in6_addr* addr ) pure
{
return addr.s6_addr[0] == 0xfe && (addr.s6_addr[1] & 0xc0) == 0xc0;
}
- extern (D) int IN6_IS_ADDR_V4MAPPED( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_V4MAPPED( const scope in6_addr* addr ) pure
{
return (cast(uint32_t*) addr)[0] == 0 &&
(cast(uint32_t*) addr)[1] == 0 &&
(cast(uint32_t*) addr)[2] == ntohl( 0x0000ffff );
}
- extern (D) int IN6_IS_ADDR_V4COMPAT( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_V4COMPAT( const scope in6_addr* addr ) pure
{
return (cast(uint32_t*) addr)[0] == 0 &&
(cast(uint32_t*) addr)[1] == 0 &&
@@ -717,31 +717,31 @@ else version (Darwin)
(cast(uint32_t*) addr)[3] != ntohl( 1 );
}
- extern (D) int IN6_IS_ADDR_MC_NODELOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_NODELOCAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST( addr ) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0x1;
}
- extern (D) int IN6_IS_ADDR_MC_LINKLOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_LINKLOCAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST( addr ) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0x2;
}
- extern (D) int IN6_IS_ADDR_MC_SITELOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_SITELOCAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST(addr) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0x5;
}
- extern (D) int IN6_IS_ADDR_MC_ORGLOCAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_ORGLOCAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST( addr) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0x8;
}
- extern (D) int IN6_IS_ADDR_MC_GLOBAL( in6_addr* addr ) pure
+ extern (D) int IN6_IS_ADDR_MC_GLOBAL( const scope in6_addr* addr ) pure
{
return IN6_IS_ADDR_MULTICAST( addr ) &&
((cast(uint8_t*) addr)[1] & 0xf) == 0xe;
diff --git a/libphobos/libdruntime/core/sys/posix/poll.d b/libphobos/libdruntime/core/sys/posix/poll.d
index 7c2d570..5901f62 100644
--- a/libphobos/libdruntime/core/sys/posix/poll.d
+++ b/libphobos/libdruntime/core/sys/posix/poll.d
@@ -29,7 +29,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// XOpen (XSI)
diff --git a/libphobos/libdruntime/core/sys/posix/pthread.d b/libphobos/libdruntime/core/sys/posix/pthread.d
index 395ed0f..6c5f1a9 100644
--- a/libphobos/libdruntime/core/sys/posix/pthread.d
+++ b/libphobos/libdruntime/core/sys/posix/pthread.d
@@ -33,7 +33,6 @@ else version (WatchOS)
version (Posix):
extern (C)
nothrow:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/pwd.d b/libphobos/libdruntime/core/sys/posix/pwd.d
index e7ddda7..e2a77de 100644
--- a/libphobos/libdruntime/core/sys/posix/pwd.d
+++ b/libphobos/libdruntime/core/sys/posix/pwd.d
@@ -30,7 +30,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/sched.d b/libphobos/libdruntime/core/sys/posix/sched.d
index 35463d4..ba7ab89 100644
--- a/libphobos/libdruntime/core/sys/posix/sched.d
+++ b/libphobos/libdruntime/core/sys/posix/sched.d
@@ -32,7 +32,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// Required
@@ -66,7 +65,10 @@ version (linux)
{
int sched_priority;
int __reserved1;
- timespec[2] __reserved2;
+ static if (muslRedirTime64)
+ c_long[2] __reserved2;
+ else
+ timespec[2] __reserved2;
int __reserved3;
}
}
@@ -283,6 +285,7 @@ else version (CRuntime_Musl)
{
int sched_get_priority_max(int);
int sched_get_priority_min(int);
+ pragma(mangle, muslRedirTime64Mangle!("sched_rr_get_interval", "__sched_rr_get_interval_time64"))
int sched_rr_get_interval(pid_t, timespec*);
}
else version (CRuntime_UClibc)
diff --git a/libphobos/libdruntime/core/sys/posix/semaphore.d b/libphobos/libdruntime/core/sys/posix/semaphore.d
index a163e59..4f3b6e9 100644
--- a/libphobos/libdruntime/core/sys/posix/semaphore.d
+++ b/libphobos/libdruntime/core/sys/posix/semaphore.d
@@ -30,7 +30,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// Required
@@ -217,6 +216,7 @@ else version (CRuntime_Bionic)
}
else version (CRuntime_Musl)
{
+ pragma(mangle, muslRedirTime64Mangle!("sem_timedwait", "__sem_timedwait_time64"))
int sem_timedwait(sem_t*, const scope timespec*);
}
else version (CRuntime_UClibc)
diff --git a/libphobos/libdruntime/core/sys/posix/setjmp.d b/libphobos/libdruntime/core/sys/posix/setjmp.d
index 91e3a19..0d43c61 100644
--- a/libphobos/libdruntime/core/sys/posix/setjmp.d
+++ b/libphobos/libdruntime/core/sys/posix/setjmp.d
@@ -19,7 +19,6 @@ import core.sys.posix.signal; // for sigset_t
version (Posix):
extern (C) nothrow @nogc:
-@system:
version (RISCV32) version = RISCV_Any;
version (RISCV64) version = RISCV_Any;
@@ -370,6 +369,22 @@ else version (CRuntime_UClibc)
double[6] __fpregs;
}
}
+ else version (MIPS64)
+ {
+ struct __jmp_buf
+ {
+ long __pc;
+ long __sp;
+ long[8] __regs;
+ long __fp;
+ long __gp;
+ int __fpc_csr;
+ version (MIPS_N64)
+ double[8] __fpregs;
+ else
+ double[6] __fpregs;
+ }
+ }
else
static assert(0, "unimplemented");
diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d
index 542e83a..f722bc4 100644
--- a/libphobos/libdruntime/core/sys/posix/signal.d
+++ b/libphobos/libdruntime/core/sys/posix/signal.d
@@ -2990,6 +2990,7 @@ else version (CRuntime_Bionic)
else version (CRuntime_Musl)
{
int sigqueue(pid_t, int, const sigval);
+ pragma(mangle, muslRedirTime64Mangle!("sigtimedwait", "__sigtimedwait_time64"))
int sigtimedwait(const scope sigset_t*, siginfo_t*, const scope timespec*);
int sigwaitinfo(const scope sigset_t*, siginfo_t*);
}
diff --git a/libphobos/libdruntime/core/sys/posix/spawn.d b/libphobos/libdruntime/core/sys/posix/spawn.d
index 2064962..7890533 100644
--- a/libphobos/libdruntime/core/sys/posix/spawn.d
+++ b/libphobos/libdruntime/core/sys/posix/spawn.d
@@ -49,7 +49,6 @@ public import core.sys.posix.sched : sched_param;
extern(C):
@nogc:
nothrow:
-@system:
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);
diff --git a/libphobos/libdruntime/core/sys/posix/stdio.d b/libphobos/libdruntime/core/sys/posix/stdio.d
index d0d3d60..d379989 100644
--- a/libphobos/libdruntime/core/sys/posix/stdio.d
+++ b/libphobos/libdruntime/core/sys/posix/stdio.d
@@ -32,7 +32,6 @@ extern (C):
nothrow:
@nogc:
-@system:
//
// Required (defined in core.stdc.stdio)
diff --git a/libphobos/libdruntime/core/sys/posix/stdlib.d b/libphobos/libdruntime/core/sys/posix/stdlib.d
index 4c10d4e..8dd7b68 100644
--- a/libphobos/libdruntime/core/sys/posix/stdlib.d
+++ b/libphobos/libdruntime/core/sys/posix/stdlib.d
@@ -31,7 +31,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// Required (defined in core.stdc.stdlib)
@@ -95,44 +94,44 @@ int posix_memalign(void**, size_t, size_t);
version (CRuntime_Glibc)
{
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
else version (FreeBSD)
{
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
else version (NetBSD)
{
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
else version (OpenBSD)
{
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
else version (DragonFlyBSD)
{
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
else version (Solaris)
{
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
else version (Darwin)
{
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
else version (CRuntime_Bionic)
{
// Added since Lollipop
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
else version (CRuntime_Musl)
{
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
else version (CRuntime_UClibc)
{
- int posix_memalign(void**, size_t, size_t);
+ int posix_memalign(scope void**, size_t, size_t) pure;
}
//
diff --git a/libphobos/libdruntime/core/sys/posix/string.d b/libphobos/libdruntime/core/sys/posix/string.d
index 79d2562..8c4ea38 100644
--- a/libphobos/libdruntime/core/sys/posix/string.d
+++ b/libphobos/libdruntime/core/sys/posix/string.d
@@ -16,7 +16,6 @@ module core.sys.posix.string;
version (Posix):
extern(C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/sys/posix/strings.d b/libphobos/libdruntime/core/sys/posix/strings.d
index 96fbccc..768a47f 100644
--- a/libphobos/libdruntime/core/sys/posix/strings.d
+++ b/libphobos/libdruntime/core/sys/posix/strings.d
@@ -15,7 +15,6 @@ module core.sys.posix.strings;
version (Posix):
extern(C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/sys/posix/sys/filio.d b/libphobos/libdruntime/core/sys/posix/sys/filio.d
index a8d837c..bedbd6a 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/filio.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/filio.d
@@ -20,7 +20,6 @@ else version (WatchOS)
version (Posix):
nothrow @nogc:
-@system:
version (Darwin)
{
diff --git a/libphobos/libdruntime/core/sys/posix/sys/ioccom.d b/libphobos/libdruntime/core/sys/posix/sys/ioccom.d
index 4a0e96b..3691765 100755
--- a/libphobos/libdruntime/core/sys/posix/sys/ioccom.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/ioccom.d
@@ -18,7 +18,6 @@ else version (WatchOS)
version (Posix):
nothrow @nogc:
-@system:
version (Darwin)
{
diff --git a/libphobos/libdruntime/core/sys/posix/sys/ioctl.d b/libphobos/libdruntime/core/sys/posix/sys/ioctl.d
index 36d1edc..caf3eba 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/ioctl.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/ioctl.d
@@ -29,7 +29,6 @@ else version (WatchOS)
version (Posix):
extern (C) nothrow @nogc:
-@system:
version (linux)
{
diff --git a/libphobos/libdruntime/core/sys/posix/sys/ipc.d b/libphobos/libdruntime/core/sys/posix/sys/ipc.d
index 1718243..32caba9 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/ipc.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/ipc.d
@@ -28,7 +28,6 @@ else version (WatchOS)
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// XOpen (XSI)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d
index 430f215..0d3d517 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/mman.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d
@@ -45,7 +45,6 @@ version (X86_64) version = X86_Any;
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// Advisory Information (ADV)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/msg.d b/libphobos/libdruntime/core/sys/posix/sys/msg.d
index 4760f2e..208e5c2 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/msg.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/msg.d
@@ -14,7 +14,6 @@ import core.stdc.config;
version (CRuntime_Glibc):
// Some of these may be from linux kernel headers.
extern (C):
-@system:
version (ARM) version = ARM_Any;
version (AArch64) version = ARM_Any;
diff --git a/libphobos/libdruntime/core/sys/posix/sys/resource.d b/libphobos/libdruntime/core/sys/posix/sys/resource.d
index 5ab0174..b997f11 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/resource.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/resource.d
@@ -23,7 +23,6 @@ else version (WatchOS)
version = Darwin;
nothrow @nogc extern(C):
-@system:
//
// XOpen (XSI)
@@ -548,6 +547,7 @@ else version (CRuntime_Musl)
int setrlimit(int, const scope rlimit*);
alias getrlimit getrlimit64;
alias setrlimit setrlimit64;
+ pragma(mangle, muslRedirTime64Mangle!("getrusage", "__getrusage_time64"))
int getrusage(int, rusage*);
}
else version (Solaris)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/select.d b/libphobos/libdruntime/core/sys/posix/sys/select.d
index 925976d..dd05d08 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/select.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/select.d
@@ -27,7 +27,6 @@ else version (WatchOS)
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// Required
@@ -502,7 +501,9 @@ else version (CRuntime_Musl)
{
fdset.fds_bits[0 .. $] = 0;
}
+ pragma(mangle, muslRedirTime64Mangle!("pselect", "__pselect_time64"))
int pselect(int, fd_set*, fd_set*, fd_set*, const scope timespec*, const scope sigset_t*);
+ pragma(mangle, muslRedirTime64Mangle!("select", "__select_time64"))
int select(int, fd_set*, fd_set*, fd_set*, timeval*);
}
else version (CRuntime_UClibc)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/shm.d b/libphobos/libdruntime/core/sys/posix/sys/shm.d
index d04e792..6ecdc0d 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/shm.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/shm.d
@@ -29,7 +29,6 @@ else version (WatchOS)
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// XOpen (XSI)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d
index fc5dc5d..340f3ce 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/socket.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d
@@ -45,7 +45,6 @@ version (X86_64) version = X86_Any;
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/sys/stat.d b/libphobos/libdruntime/core/sys/posix/sys/stat.d
index 1fb4e44..ee9e5da 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/stat.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d
@@ -35,7 +35,6 @@ version (SPARC64) version = SPARC_Any;
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// Required
@@ -1657,7 +1656,6 @@ else version (CRuntime_Bionic)
}
else version (CRuntime_Musl)
{
- alias __mode_t = uint;
enum {
S_IRUSR = 0x100, // octal 0400
S_IWUSR = 0x080, // octal 0200
@@ -1891,8 +1889,11 @@ else version (CRuntime_Bionic)
}
else version (CRuntime_Musl)
{
+ pragma(mangle, muslRedirTime64Mangle!("stat", "__stat_time64"))
int stat(const scope char*, stat_t*);
+ pragma(mangle, muslRedirTime64Mangle!("fstat", "__fstat_time64"))
int fstat(int, stat_t*);
+ pragma(mangle, muslRedirTime64Mangle!("lstat", "__lstat_time64"))
int lstat(const scope char*, stat_t*);
alias fstat fstat64;
diff --git a/libphobos/libdruntime/core/sys/posix/sys/statvfs.d b/libphobos/libdruntime/core/sys/posix/sys/statvfs.d
index df9030d..eae0e5c 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/statvfs.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/statvfs.d
@@ -16,7 +16,6 @@ version (Posix):
extern (C) :
nothrow:
@nogc:
-@system:
version (CRuntime_Glibc) {
static if (__WORDSIZE == 32)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/time.d b/libphobos/libdruntime/core/sys/posix/sys/time.d
index 95cf883..dda4caf 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/time.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/time.d
@@ -31,7 +31,6 @@ version (linux) public import core.sys.linux.sys.time;
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// XOpen (XSI)
@@ -90,7 +89,9 @@ else version (CRuntime_Musl)
time_t tv_sec;
suseconds_t tv_usec;
}
+ pragma(mangle, muslRedirTime64Mangle!("gettimeofday", "__gettimeofday_time64"))
int gettimeofday(timeval*, void*);
+ pragma(mangle, muslRedirTime64Mangle!("utimes", "__utimes_time64"))
int utimes(const scope char*, ref const(timeval)[2]);
}
else version (Darwin)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/ttycom.d b/libphobos/libdruntime/core/sys/posix/sys/ttycom.d
index 0cc2d9c..f4c9c58 100755
--- a/libphobos/libdruntime/core/sys/posix/sys/ttycom.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/ttycom.d
@@ -22,7 +22,6 @@ else version (WatchOS)
version (Posix):
nothrow @nogc:
-@system:
version (Darwin)
{
diff --git a/libphobos/libdruntime/core/sys/posix/sys/types.d b/libphobos/libdruntime/core/sys/posix/sys/types.d
index ec229dd..cd11b0d 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/types.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/types.d
@@ -30,7 +30,6 @@ else version (WatchOS)
version (Posix):
extern (C):
-@system:
//
// bits/typesizes.h -- underlying types for *_t.
@@ -1140,6 +1139,18 @@ else version (CRuntime_UClibc)
enum __SIZEOF_PTHREAD_BARRIER_T = 20;
enum __SIZEOF_PTHREAD_BARRIERATTR_T = 4;
}
+ else version (MIPS64)
+ {
+ enum __SIZEOF_PTHREAD_ATTR_T = 56;
+ enum __SIZEOF_PTHREAD_MUTEX_T = 40;
+ enum __SIZEOF_PTHREAD_MUTEXATTR_T = 4;
+ enum __SIZEOF_PTHREAD_COND_T = 48;
+ enum __SIZEOF_PTHREAD_CONDATTR_T = 4;
+ enum __SIZEOF_PTHREAD_RWLOCK_T = 56;
+ enum __SIZEOF_PTHREAD_RWLOCKATTR_T = 8;
+ enum __SIZEOF_PTHREAD_BARRIER_T = 32;
+ enum __SIZEOF_PTHREAD_BARRIERATTR_T = 4;
+ }
else version (ARM)
{
enum __SIZEOF_PTHREAD_ATTR_T = 36;
diff --git a/libphobos/libdruntime/core/sys/posix/sys/uio.d b/libphobos/libdruntime/core/sys/posix/sys/uio.d
index 2563c6d..e283963 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/uio.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/uio.d
@@ -28,7 +28,6 @@ else version (WatchOS)
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/sys/un.d b/libphobos/libdruntime/core/sys/posix/sys/un.d
index 5030e16..11e98a7 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/un.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/un.d
@@ -25,7 +25,6 @@ else version (WatchOS)
version (Posix):
extern(C):
-@system:
public import core.sys.posix.sys.socket: sa_family_t;
diff --git a/libphobos/libdruntime/core/sys/posix/sys/utsname.d b/libphobos/libdruntime/core/sys/posix/sys/utsname.d
index 0abbf14..5de50ac 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/utsname.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/utsname.d
@@ -16,7 +16,6 @@ version (Posix):
extern(C):
nothrow:
@nogc:
-@system:
version (CRuntime_Glibc)
{
diff --git a/libphobos/libdruntime/core/sys/posix/sys/wait.d b/libphobos/libdruntime/core/sys/posix/sys/wait.d
index 91b9c9e..f6b0674 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/wait.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/wait.d
@@ -30,7 +30,6 @@ else version (WatchOS)
version (Posix):
extern (C) nothrow @nogc:
-@system:
//
// Required
@@ -387,9 +386,15 @@ else version (NetBSD)
else version (OpenBSD)
{
enum WCONTINUED = 8;
- // OpenBSD does not define the following:
- //enum WSTOPPED
- //enum WNOWAIT
+ enum WSTOPPED = WUNTRACED;
+ enum WNOWAIT = 16;
+
+ enum idtype_t
+ {
+ P_ALL,
+ P_PID,
+ P_PGID
+ }
}
else version (DragonFlyBSD)
{
@@ -452,6 +457,7 @@ else version (NetBSD)
}
else version (OpenBSD)
{
+ int waitid(idtype_t, id_t, siginfo_t*, int);
}
else version (DragonFlyBSD)
{
diff --git a/libphobos/libdruntime/core/sys/posix/syslog.d b/libphobos/libdruntime/core/sys/posix/syslog.d
index cf85664..ba2a4ac 100644
--- a/libphobos/libdruntime/core/sys/posix/syslog.d
+++ b/libphobos/libdruntime/core/sys/posix/syslog.d
@@ -27,7 +27,6 @@ else version (WatchOS)
version (Posix):
extern (C) nothrow @nogc:
-@system:
version (CRuntime_Glibc)
{
diff --git a/libphobos/libdruntime/core/sys/posix/termios.d b/libphobos/libdruntime/core/sys/posix/termios.d
index 357060b..e4a99e6 100644
--- a/libphobos/libdruntime/core/sys/posix/termios.d
+++ b/libphobos/libdruntime/core/sys/posix/termios.d
@@ -31,7 +31,6 @@ extern (C):
nothrow:
@nogc:
-@system:
//
// Required
diff --git a/libphobos/libdruntime/core/sys/posix/time.d b/libphobos/libdruntime/core/sys/posix/time.d
index ff3a3c4..f49764d 100644
--- a/libphobos/libdruntime/core/sys/posix/time.d
+++ b/libphobos/libdruntime/core/sys/posix/time.d
@@ -33,7 +33,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// Required (defined in core.stdc.time)
@@ -84,6 +83,7 @@ else version (CRuntime_Bionic)
}
else version (CRuntime_Musl)
{
+ pragma(mangle, muslRedirTime64Mangle!("timegm", "__timegm_time64"))
time_t timegm(tm*);
}
else version (CRuntime_UClibc)
@@ -484,15 +484,21 @@ else version (CRuntime_Musl)
int nanosleep(const scope timespec*, timespec*);
+ pragma(mangle, muslRedirTime64Mangle!("clock_getres", "__clock_getres_time64"))
int clock_getres(clockid_t, timespec*);
+ pragma(mangle, muslRedirTime64Mangle!("clock_gettime", "__clock_gettime64"))
int clock_gettime(clockid_t, timespec*);
+ pragma(mangle, muslRedirTime64Mangle!("clock_settime", "__clock_settime64"))
int clock_settime(clockid_t, const scope timespec*);
+ pragma(mangle, muslRedirTime64Mangle!("clock_nanosleep", "__clock_nanosleep_time64"))
int clock_nanosleep(clockid_t, int, const scope timespec*, timespec*);
int clock_getcpuclockid(pid_t, clockid_t *);
int timer_create(clockid_t, sigevent*, timer_t*);
int timer_delete(timer_t);
+ pragma(mangle, muslRedirTime64Mangle!("timer_gettime", "__timer_gettime64"))
int timer_gettime(timer_t, itimerspec*);
+ pragma(mangle, muslRedirTime64Mangle!("timer_settime", "__timer_settime64"))
int timer_settime(timer_t, int, const scope itimerspec*, itimerspec*);
int timer_getoverrun(timer_t);
}
@@ -597,8 +603,11 @@ else version (CRuntime_Bionic)
else version (CRuntime_Musl)
{
char* asctime_r(const scope tm*, char*);
+ pragma(mangle, muslRedirTime64Mangle!("ctime_r", "__ctime64_r"))
char* ctime_r(const scope time_t*, char*);
+ pragma(mangle, muslRedirTime64Mangle!("gmtime_r", "__gmtime64_r"))
tm* gmtime_r(const scope time_t*, tm*);
+ pragma(mangle, muslRedirTime64Mangle!("localtime_r", "__localtime64_r"))
tm* localtime_r(const scope time_t*, tm*);
}
else version (CRuntime_UClibc)
diff --git a/libphobos/libdruntime/core/sys/posix/ucontext.d b/libphobos/libdruntime/core/sys/posix/ucontext.d
index e8c2f87..512d730 100644
--- a/libphobos/libdruntime/core/sys/posix/ucontext.d
+++ b/libphobos/libdruntime/core/sys/posix/ucontext.d
@@ -22,7 +22,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
version (OSX)
version = Darwin;
diff --git a/libphobos/libdruntime/core/sys/posix/unistd.d b/libphobos/libdruntime/core/sys/posix/unistd.d
index d996556..d1300e1 100644
--- a/libphobos/libdruntime/core/sys/posix/unistd.d
+++ b/libphobos/libdruntime/core/sys/posix/unistd.d
@@ -32,7 +32,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
enum STDIN_FILENO = 0;
enum STDOUT_FILENO = 1;
diff --git a/libphobos/libdruntime/core/sys/posix/utime.d b/libphobos/libdruntime/core/sys/posix/utime.d
index 66aea58..e7059d7 100644
--- a/libphobos/libdruntime/core/sys/posix/utime.d
+++ b/libphobos/libdruntime/core/sys/posix/utime.d
@@ -30,7 +30,6 @@ version (Posix):
extern (C):
nothrow:
@nogc:
-@system:
//
// Required
@@ -63,6 +62,7 @@ else version (CRuntime_Musl)
time_t modtime;
}
+ pragma(mangle, muslRedirTime64Mangle!("utime", "__utime64"))
int utime(const scope char*, const scope utimbuf*);
}
else version (Darwin)
diff --git a/libphobos/libdruntime/core/sys/windows/aclapi.d b/libphobos/libdruntime/core/sys/windows/aclapi.d
index f145ac2..4905351 100644
--- a/libphobos/libdruntime/core/sys/windows/aclapi.d
+++ b/libphobos/libdruntime/core/sys/windows/aclapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.aclapi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "advapi32");
diff --git a/libphobos/libdruntime/core/sys/windows/aclui.d b/libphobos/libdruntime/core/sys/windows/aclui.d
index c5a2899..08be626 100644
--- a/libphobos/libdruntime/core/sys/windows/aclui.d
+++ b/libphobos/libdruntime/core/sys/windows/aclui.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.aclui;
version (Windows):
-@system:
pragma(lib, "aclui");
import core.sys.windows.w32api;
diff --git a/libphobos/libdruntime/core/sys/windows/basetsd.d b/libphobos/libdruntime/core/sys/windows/basetsd.d
index 0c68902..3c5c35f 100644
--- a/libphobos/libdruntime/core/sys/windows/basetsd.d
+++ b/libphobos/libdruntime/core/sys/windows/basetsd.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.basetsd;
version (Windows):
-@system:
/* This template is used in these modules to declare constant pointer types,
* in order to support both D 1.x and 2.x.
diff --git a/libphobos/libdruntime/core/sys/windows/basetyps.d b/libphobos/libdruntime/core/sys/windows/basetyps.d
index 086e6ab..d90d9f3 100644
--- a/libphobos/libdruntime/core/sys/windows/basetyps.d
+++ b/libphobos/libdruntime/core/sys/windows/basetyps.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.basetyps;
version (Windows):
-@system:
import core.sys.windows.windef, core.sys.windows.basetsd;
diff --git a/libphobos/libdruntime/core/sys/windows/com.d b/libphobos/libdruntime/core/sys/windows/com.d
index 6935dd9..c724f1c 100644
--- a/libphobos/libdruntime/core/sys/windows/com.d
+++ b/libphobos/libdruntime/core/sys/windows/com.d
@@ -1,6 +1,5 @@
module core.sys.windows.com;
version (Windows):
-@system:
pragma(lib,"uuid");
diff --git a/libphobos/libdruntime/core/sys/windows/comcat.d b/libphobos/libdruntime/core/sys/windows/comcat.d
index 3018c64..4cc35f4 100644
--- a/libphobos/libdruntime/core/sys/windows/comcat.d
+++ b/libphobos/libdruntime/core/sys/windows/comcat.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.comcat;
version (Windows):
-@system:
import core.sys.windows.ole2;
import core.sys.windows.basetyps, core.sys.windows.cguid, core.sys.windows.objbase, core.sys.windows.unknwn,
diff --git a/libphobos/libdruntime/core/sys/windows/commctrl.d b/libphobos/libdruntime/core/sys/windows/commctrl.d
index 4bc60b1..dabee56 100644
--- a/libphobos/libdruntime/core/sys/windows/commctrl.d
+++ b/libphobos/libdruntime/core/sys/windows/commctrl.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.commctrl;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "comctl32");
diff --git a/libphobos/libdruntime/core/sys/windows/commdlg.d b/libphobos/libdruntime/core/sys/windows/commdlg.d
index b49d2fb..9be9a9f 100644
--- a/libphobos/libdruntime/core/sys/windows/commdlg.d
+++ b/libphobos/libdruntime/core/sys/windows/commdlg.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.commdlg;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "comdlg32");
diff --git a/libphobos/libdruntime/core/sys/windows/cpl.d b/libphobos/libdruntime/core/sys/windows/cpl.d
index 49ebb20..df98703 100644
--- a/libphobos/libdruntime/core/sys/windows/cpl.d
+++ b/libphobos/libdruntime/core/sys/windows/cpl.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.cpl;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/cplext.d b/libphobos/libdruntime/core/sys/windows/cplext.d
index e13316b..4aff3a9 100644
--- a/libphobos/libdruntime/core/sys/windows/cplext.d
+++ b/libphobos/libdruntime/core/sys/windows/cplext.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.cplext;
version (Windows):
-@system:
enum : uint {
CPLPAGE_MOUSE_BUTTONS = 1,
diff --git a/libphobos/libdruntime/core/sys/windows/custcntl.d b/libphobos/libdruntime/core/sys/windows/custcntl.d
index c736cb3..f9234ac 100644
--- a/libphobos/libdruntime/core/sys/windows/custcntl.d
+++ b/libphobos/libdruntime/core/sys/windows/custcntl.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.custcntl;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/dbghelp.d b/libphobos/libdruntime/core/sys/windows/dbghelp.d
index 96698e8..55fbc56 100644
--- a/libphobos/libdruntime/core/sys/windows/dbghelp.d
+++ b/libphobos/libdruntime/core/sys/windows/dbghelp.d
@@ -11,7 +11,6 @@
module core.sys.windows.dbghelp;
version (Windows):
-@system:
import core.sys.windows.winbase /+: FreeLibrary, GetProcAddress, LoadLibraryA+/;
import core.sys.windows.windef;
@@ -32,7 +31,7 @@ extern(Windows)
alias PVOID function(HANDLE hProcess, DWORD64 AddrBase) SymFunctionTableAccess64Func;
alias BOOL function(DWORD MachineType, HANDLE hProcess, HANDLE hThread, STACKFRAME64 *StackFrame, PVOID ContextRecord,
ReadProcessMemoryProc64 ReadMemoryRoutine, FunctionTableAccessProc64 FunctoinTableAccess,
- GetModuleBaseProc64 GetModuleBaseRoutine, TranslateAddressProc64 TranslateAddress) StackWalk64Func;
+ GetModuleBaseProc64 GetModuleBaseRoutine, TranslateAddressProc64 TranslateAddress) @nogc StackWalk64Func;
alias BOOL function(HANDLE hProcess, DWORD64 dwAddr, PDWORD pdwDisplacement, IMAGEHLP_LINEA64 *line) SymGetLineFromAddr64Func;
alias DWORD64 function(HANDLE hProcess, DWORD64 dwAddr) SymGetModuleBase64Func;
alias BOOL function(HANDLE hProcess, DWORD64 dwAddr, IMAGEHLP_MODULEA64 *ModuleInfo) SymGetModuleInfo64Func;
@@ -67,7 +66,7 @@ struct DbgHelp
SymRegisterCallback64Func SymRegisterCallback64;
ImagehlpApiVersionFunc ImagehlpApiVersion;
- static DbgHelp* get()
+ static DbgHelp* get() @nogc
{
if ( sm_hndl != sm_hndl.init )
return &sm_inst;
diff --git a/libphobos/libdruntime/core/sys/windows/dbghelp_types.d b/libphobos/libdruntime/core/sys/windows/dbghelp_types.d
index 64477df..f75f98b 100644
--- a/libphobos/libdruntime/core/sys/windows/dbghelp_types.d
+++ b/libphobos/libdruntime/core/sys/windows/dbghelp_types.d
@@ -11,7 +11,6 @@
module core.sys.windows.dbghelp_types;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/dbt.d b/libphobos/libdruntime/core/sys/windows/dbt.d
index 308c609..41f1c32 100644
--- a/libphobos/libdruntime/core/sys/windows/dbt.d
+++ b/libphobos/libdruntime/core/sys/windows/dbt.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.dbt;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/dde.d b/libphobos/libdruntime/core/sys/windows/dde.d
index bec339c..d9b8bec 100644
--- a/libphobos/libdruntime/core/sys/windows/dde.d
+++ b/libphobos/libdruntime/core/sys/windows/dde.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.dde;
version (Windows):
-@system:
pragma(lib, "user32");
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/ddeml.d b/libphobos/libdruntime/core/sys/windows/ddeml.d
index 22b330c..00bad1d 100644
--- a/libphobos/libdruntime/core/sys/windows/ddeml.d
+++ b/libphobos/libdruntime/core/sys/windows/ddeml.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.ddeml;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "user32");
diff --git a/libphobos/libdruntime/core/sys/windows/dhcpcsdk.d b/libphobos/libdruntime/core/sys/windows/dhcpcsdk.d
index 0d3d716..d21169a 100644
--- a/libphobos/libdruntime/core/sys/windows/dhcpcsdk.d
+++ b/libphobos/libdruntime/core/sys/windows/dhcpcsdk.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.dhcpcsdk;
version (Windows):
-@system:
import core.sys.windows.w32api, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/dlgs.d b/libphobos/libdruntime/core/sys/windows/dlgs.d
index 34cab9b..5256862 100644
--- a/libphobos/libdruntime/core/sys/windows/dlgs.d
+++ b/libphobos/libdruntime/core/sys/windows/dlgs.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.dlgs;
version (Windows):
-@system:
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/dll.d b/libphobos/libdruntime/core/sys/windows/dll.d
index d602347..367c1d9 100644
--- a/libphobos/libdruntime/core/sys/windows/dll.d
+++ b/libphobos/libdruntime/core/sys/windows/dll.d
@@ -14,7 +14,6 @@
*/
module core.sys.windows.dll;
version (Windows):
-@system:
import core.sys.windows.winbase;
import core.sys.windows.winnt;
diff --git a/libphobos/libdruntime/core/sys/windows/docobj.d b/libphobos/libdruntime/core/sys/windows/docobj.d
index 4e45693..4abbea3 100644
--- a/libphobos/libdruntime/core/sys/windows/docobj.d
+++ b/libphobos/libdruntime/core/sys/windows/docobj.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.docobj;
version (Windows):
-@system:
import core.sys.windows.basetyps, core.sys.windows.oaidl, core.sys.windows.objidl, core.sys.windows.oleidl,
core.sys.windows.unknwn, core.sys.windows.windef, core.sys.windows.wtypes;
diff --git a/libphobos/libdruntime/core/sys/windows/errorrep.d b/libphobos/libdruntime/core/sys/windows/errorrep.d
index 63ec8d7..42fad9a 100644
--- a/libphobos/libdruntime/core/sys/windows/errorrep.d
+++ b/libphobos/libdruntime/core/sys/windows/errorrep.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.errorrep;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/exdisp.d b/libphobos/libdruntime/core/sys/windows/exdisp.d
index 8ee3c26..5a9ea98 100644
--- a/libphobos/libdruntime/core/sys/windows/exdisp.d
+++ b/libphobos/libdruntime/core/sys/windows/exdisp.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.exdisp;
version (Windows):
-@system:
import core.sys.windows.docobj, core.sys.windows.oaidl, core.sys.windows.ocidl;
import core.sys.windows.basetyps, core.sys.windows.windef, core.sys.windows.wtypes;
diff --git a/libphobos/libdruntime/core/sys/windows/httpext.d b/libphobos/libdruntime/core/sys/windows/httpext.d
index 4e07c6a..6973879 100644
--- a/libphobos/libdruntime/core/sys/windows/httpext.d
+++ b/libphobos/libdruntime/core/sys/windows/httpext.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.httpext;
version (Windows):
-@system:
/* Comment from MinGW
httpext.h - Header for ISAPI extensions.
diff --git a/libphobos/libdruntime/core/sys/windows/imagehlp.d b/libphobos/libdruntime/core/sys/windows/imagehlp.d
index ed93746..399c0b2 100644
--- a/libphobos/libdruntime/core/sys/windows/imagehlp.d
+++ b/libphobos/libdruntime/core/sys/windows/imagehlp.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.imagehlp;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/imm.d b/libphobos/libdruntime/core/sys/windows/imm.d
index 128fd56..4ad678c 100644
--- a/libphobos/libdruntime/core/sys/windows/imm.d
+++ b/libphobos/libdruntime/core/sys/windows/imm.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.imm;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "imm32");
diff --git a/libphobos/libdruntime/core/sys/windows/intshcut.d b/libphobos/libdruntime/core/sys/windows/intshcut.d
index eab7a8d..ab662e4 100644
--- a/libphobos/libdruntime/core/sys/windows/intshcut.d
+++ b/libphobos/libdruntime/core/sys/windows/intshcut.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.intshcut;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/ipexport.d b/libphobos/libdruntime/core/sys/windows/ipexport.d
index dbb4a0e..b0a4a01 100644
--- a/libphobos/libdruntime/core/sys/windows/ipexport.d
+++ b/libphobos/libdruntime/core/sys/windows/ipexport.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.ipexport;
version (Windows):
-@system:
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/iphlpapi.d b/libphobos/libdruntime/core/sys/windows/iphlpapi.d
index f95e799..4a8e64c 100644
--- a/libphobos/libdruntime/core/sys/windows/iphlpapi.d
+++ b/libphobos/libdruntime/core/sys/windows/iphlpapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.iphlpapi;
version (Windows):
-@system:
import core.sys.windows.ipexport, core.sys.windows.iprtrmib, core.sys.windows.iptypes;
import core.sys.windows.winbase, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/iprtrmib.d b/libphobos/libdruntime/core/sys/windows/iprtrmib.d
index 3db4539..05c31b3 100644
--- a/libphobos/libdruntime/core/sys/windows/iprtrmib.d
+++ b/libphobos/libdruntime/core/sys/windows/iprtrmib.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.iprtrmib;
version (Windows):
-@system:
import core.sys.windows.ipifcons;
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/iptypes.d b/libphobos/libdruntime/core/sys/windows/iptypes.d
index 7cce34b..baaf6ae 100644
--- a/libphobos/libdruntime/core/sys/windows/iptypes.d
+++ b/libphobos/libdruntime/core/sys/windows/iptypes.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.iptypes;
version (Windows):
-@system:
import core.sys.windows.windef;
import core.stdc.time;
diff --git a/libphobos/libdruntime/core/sys/windows/lm.d b/libphobos/libdruntime/core/sys/windows/lm.d
index 3d48856..115925c 100644
--- a/libphobos/libdruntime/core/sys/windows/lm.d
+++ b/libphobos/libdruntime/core/sys/windows/lm.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lm;
version (Windows):
-@system:
/* removed - now supporting only Win2k up
version (WindowsVista) {
diff --git a/libphobos/libdruntime/core/sys/windows/lmaccess.d b/libphobos/libdruntime/core/sys/windows/lmaccess.d
index b23e52e..9791ff6 100644
--- a/libphobos/libdruntime/core/sys/windows/lmaccess.d
+++ b/libphobos/libdruntime/core/sys/windows/lmaccess.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmaccess;
version (Windows):
-@system:
pragma(lib, "netapi32");
/**
diff --git a/libphobos/libdruntime/core/sys/windows/lmalert.d b/libphobos/libdruntime/core/sys/windows/lmalert.d
index 5ddd6d0..ad0c3ca 100644
--- a/libphobos/libdruntime/core/sys/windows/lmalert.d
+++ b/libphobos/libdruntime/core/sys/windows/lmalert.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmalert;
version (Windows):
-@system:
pragma(lib, "netapi32");
import core.sys.windows.lmcons, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/lmat.d b/libphobos/libdruntime/core/sys/windows/lmat.d
index 3e1468a..ee1249e 100644
--- a/libphobos/libdruntime/core/sys/windows/lmat.d
+++ b/libphobos/libdruntime/core/sys/windows/lmat.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmat;
version (Windows):
-@system:
pragma(lib, "netapi32");
import core.sys.windows.lmcons, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/lmaudit.d b/libphobos/libdruntime/core/sys/windows/lmaudit.d
index f4a7ca2..8db56f1 100644
--- a/libphobos/libdruntime/core/sys/windows/lmaudit.d
+++ b/libphobos/libdruntime/core/sys/windows/lmaudit.d
@@ -9,7 +9,6 @@
// COMMENT: This file may be deprecated.
module core.sys.windows.lmaudit;
version (Windows):
-@system:
import core.sys.windows.lmcons, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/lmbrowsr.d b/libphobos/libdruntime/core/sys/windows/lmbrowsr.d
index ea0e0f3..16cc661 100644
--- a/libphobos/libdruntime/core/sys/windows/lmbrowsr.d
+++ b/libphobos/libdruntime/core/sys/windows/lmbrowsr.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmbrowsr;
version (Windows):
-@system:
import core.sys.windows.lmcons, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/lmchdev.d b/libphobos/libdruntime/core/sys/windows/lmchdev.d
index 00aaafc..55460e1 100644
--- a/libphobos/libdruntime/core/sys/windows/lmchdev.d
+++ b/libphobos/libdruntime/core/sys/windows/lmchdev.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmchdev;
version (Windows):
-@system:
// COMMENT: This file might be deprecated.
diff --git a/libphobos/libdruntime/core/sys/windows/lmconfig.d b/libphobos/libdruntime/core/sys/windows/lmconfig.d
index 57d3ed9..6652a52 100644
--- a/libphobos/libdruntime/core/sys/windows/lmconfig.d
+++ b/libphobos/libdruntime/core/sys/windows/lmconfig.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmconfig;
version (Windows):
-@system:
// All functions in this file are deprecated!
diff --git a/libphobos/libdruntime/core/sys/windows/lmcons.d b/libphobos/libdruntime/core/sys/windows/lmcons.d
index 69a63df..838748a 100644
--- a/libphobos/libdruntime/core/sys/windows/lmcons.d
+++ b/libphobos/libdruntime/core/sys/windows/lmcons.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmcons;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/lmerr.d b/libphobos/libdruntime/core/sys/windows/lmerr.d
index d50ec49..23f5e59 100644
--- a/libphobos/libdruntime/core/sys/windows/lmerr.d
+++ b/libphobos/libdruntime/core/sys/windows/lmerr.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmerr;
version (Windows):
-@system:
import core.sys.windows.winerror;
diff --git a/libphobos/libdruntime/core/sys/windows/lmerrlog.d b/libphobos/libdruntime/core/sys/windows/lmerrlog.d
index a49b498..effe73a 100644
--- a/libphobos/libdruntime/core/sys/windows/lmerrlog.d
+++ b/libphobos/libdruntime/core/sys/windows/lmerrlog.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmerrlog;
version (Windows):
-@system:
// COMMENT: This appears to be only for Win16. All functions are deprecated.
diff --git a/libphobos/libdruntime/core/sys/windows/lmmsg.d b/libphobos/libdruntime/core/sys/windows/lmmsg.d
index c87f1e0..a3abd60 100644
--- a/libphobos/libdruntime/core/sys/windows/lmmsg.d
+++ b/libphobos/libdruntime/core/sys/windows/lmmsg.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmmsg;
version (Windows):
-@system:
pragma(lib, "netapi32");
import core.sys.windows.lmcons, core.sys.windows.windef, core.sys.windows.w32api;
diff --git a/libphobos/libdruntime/core/sys/windows/lmremutl.d b/libphobos/libdruntime/core/sys/windows/lmremutl.d
index d0f3b41..8c90df7 100644
--- a/libphobos/libdruntime/core/sys/windows/lmremutl.d
+++ b/libphobos/libdruntime/core/sys/windows/lmremutl.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmremutl;
version (Windows):
-@system:
pragma(lib, "netapi32");
// D Conversion Note: DESC_CHAR is defined as TCHAR.
diff --git a/libphobos/libdruntime/core/sys/windows/lmrepl.d b/libphobos/libdruntime/core/sys/windows/lmrepl.d
index 093588c..1563a5e 100644
--- a/libphobos/libdruntime/core/sys/windows/lmrepl.d
+++ b/libphobos/libdruntime/core/sys/windows/lmrepl.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmrepl;
version (Windows):
-@system:
pragma(lib, "netapi32");
import core.sys.windows.lmcons, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/lmserver.d b/libphobos/libdruntime/core/sys/windows/lmserver.d
index fad5bc5..5a550bc 100644
--- a/libphobos/libdruntime/core/sys/windows/lmserver.d
+++ b/libphobos/libdruntime/core/sys/windows/lmserver.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmserver;
version (Windows):
-@system:
import core.sys.windows.winsvc;
import core.sys.windows.lmcons, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/lmshare.d b/libphobos/libdruntime/core/sys/windows/lmshare.d
index d81080e..bd8eecb 100644
--- a/libphobos/libdruntime/core/sys/windows/lmshare.d
+++ b/libphobos/libdruntime/core/sys/windows/lmshare.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmshare;
version (Windows):
-@system:
pragma(lib, "netapi32");
import core.sys.windows.lmcons;
diff --git a/libphobos/libdruntime/core/sys/windows/lmsname.d b/libphobos/libdruntime/core/sys/windows/lmsname.d
index 09b1b00..a8f4f76 100644
--- a/libphobos/libdruntime/core/sys/windows/lmsname.d
+++ b/libphobos/libdruntime/core/sys/windows/lmsname.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmsname;
version (Windows):
-@system:
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/lmstats.d b/libphobos/libdruntime/core/sys/windows/lmstats.d
index 4baa390..e83808b 100644
--- a/libphobos/libdruntime/core/sys/windows/lmstats.d
+++ b/libphobos/libdruntime/core/sys/windows/lmstats.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmstats;
version (Windows):
-@system:
pragma(lib, "netapi32");
import core.sys.windows.lmcons, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/lmsvc.d b/libphobos/libdruntime/core/sys/windows/lmsvc.d
index c0df699..ddea61c 100644
--- a/libphobos/libdruntime/core/sys/windows/lmsvc.d
+++ b/libphobos/libdruntime/core/sys/windows/lmsvc.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmsvc;
version (Windows):
-@system:
// FIXME: Is this file deprecated? All of the functions are only for Win16.
/**
diff --git a/libphobos/libdruntime/core/sys/windows/lmuse.d b/libphobos/libdruntime/core/sys/windows/lmuse.d
index 03e153a..a48d72e 100644
--- a/libphobos/libdruntime/core/sys/windows/lmuse.d
+++ b/libphobos/libdruntime/core/sys/windows/lmuse.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmuse;
version (Windows):
-@system:
pragma(lib, "netapi32");
import core.sys.windows.lmuseflg;
diff --git a/libphobos/libdruntime/core/sys/windows/lmwksta.d b/libphobos/libdruntime/core/sys/windows/lmwksta.d
index cdd3a07..29ddca7 100644
--- a/libphobos/libdruntime/core/sys/windows/lmwksta.d
+++ b/libphobos/libdruntime/core/sys/windows/lmwksta.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lmwksta;
version (Windows):
-@system:
pragma(lib, "netapi32");
import core.sys.windows.lmuseflg;
diff --git a/libphobos/libdruntime/core/sys/windows/lzexpand.d b/libphobos/libdruntime/core/sys/windows/lzexpand.d
index a01489b..6c3bd00 100644
--- a/libphobos/libdruntime/core/sys/windows/lzexpand.d
+++ b/libphobos/libdruntime/core/sys/windows/lzexpand.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.lzexpand;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "lz32");
diff --git a/libphobos/libdruntime/core/sys/windows/mapi.d b/libphobos/libdruntime/core/sys/windows/mapi.d
index 06fd955..8f8eea1 100644
--- a/libphobos/libdruntime/core/sys/windows/mapi.d
+++ b/libphobos/libdruntime/core/sys/windows/mapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.mapi;
version (Windows):
-@system:
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/mciavi.d b/libphobos/libdruntime/core/sys/windows/mciavi.d
index 4e3d14e..08410f5 100644
--- a/libphobos/libdruntime/core/sys/windows/mciavi.d
+++ b/libphobos/libdruntime/core/sys/windows/mciavi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.mciavi;
version (Windows):
-@system:
import core.sys.windows.mmsystem;
diff --git a/libphobos/libdruntime/core/sys/windows/mcx.d b/libphobos/libdruntime/core/sys/windows/mcx.d
index 0322413..5c6ac24 100644
--- a/libphobos/libdruntime/core/sys/windows/mcx.d
+++ b/libphobos/libdruntime/core/sys/windows/mcx.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.mcx;
version (Windows):
-@system:
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/mgmtapi.d b/libphobos/libdruntime/core/sys/windows/mgmtapi.d
index d9fb6b7..8f84eea 100644
--- a/libphobos/libdruntime/core/sys/windows/mgmtapi.d
+++ b/libphobos/libdruntime/core/sys/windows/mgmtapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.mgmtapi;
version (Windows):
-@system:
import core.sys.windows.snmp;
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/mmsystem.d b/libphobos/libdruntime/core/sys/windows/mmsystem.d
index 5c3d920..7e7c34b 100644
--- a/libphobos/libdruntime/core/sys/windows/mmsystem.d
+++ b/libphobos/libdruntime/core/sys/windows/mmsystem.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.mmsystem;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "winmm");
diff --git a/libphobos/libdruntime/core/sys/windows/msacm.d b/libphobos/libdruntime/core/sys/windows/msacm.d
index 4726328..645e40d 100644
--- a/libphobos/libdruntime/core/sys/windows/msacm.d
+++ b/libphobos/libdruntime/core/sys/windows/msacm.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.msacm;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/mshtml.d b/libphobos/libdruntime/core/sys/windows/mshtml.d
index d5cf7cb..d20c4bb 100644
--- a/libphobos/libdruntime/core/sys/windows/mshtml.d
+++ b/libphobos/libdruntime/core/sys/windows/mshtml.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.mshtml;
version (Windows):
-@system:
import core.sys.windows.basetyps, core.sys.windows.oaidl, core.sys.windows.unknwn,
core.sys.windows.windef, core.sys.windows.wtypes;
diff --git a/libphobos/libdruntime/core/sys/windows/mswsock.d b/libphobos/libdruntime/core/sys/windows/mswsock.d
index 27c0cdb..d8beee4 100644
--- a/libphobos/libdruntime/core/sys/windows/mswsock.d
+++ b/libphobos/libdruntime/core/sys/windows/mswsock.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.mswsock;
version (Windows):
-@system:
import core.sys.windows.winbase, core.sys.windows.windef;
import core.sys.windows.basetyps, core.sys.windows.w32api;
diff --git a/libphobos/libdruntime/core/sys/windows/nb30.d b/libphobos/libdruntime/core/sys/windows/nb30.d
index 8f92edd..cfa57d6 100644
--- a/libphobos/libdruntime/core/sys/windows/nb30.d
+++ b/libphobos/libdruntime/core/sys/windows/nb30.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.nb30;
version (Windows):
-@system:
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/nddeapi.d b/libphobos/libdruntime/core/sys/windows/nddeapi.d
index dc3890c..3efca62 100644
--- a/libphobos/libdruntime/core/sys/windows/nddeapi.d
+++ b/libphobos/libdruntime/core/sys/windows/nddeapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.nddeapi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/nspapi.d b/libphobos/libdruntime/core/sys/windows/nspapi.d
index 79c9fce..bac6526 100644
--- a/libphobos/libdruntime/core/sys/windows/nspapi.d
+++ b/libphobos/libdruntime/core/sys/windows/nspapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.nspapi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/ntdef.d b/libphobos/libdruntime/core/sys/windows/ntdef.d
index 78e60e7..a0213dc 100644
--- a/libphobos/libdruntime/core/sys/windows/ntdef.d
+++ b/libphobos/libdruntime/core/sys/windows/ntdef.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.ntdef;
version (Windows):
-@system:
import core.sys.windows.basetsd, core.sys.windows.subauth, core.sys.windows.windef, core.sys.windows.winnt;
diff --git a/libphobos/libdruntime/core/sys/windows/ntdll.d b/libphobos/libdruntime/core/sys/windows/ntdll.d
index 4ac1bcc..28d560c 100644
--- a/libphobos/libdruntime/core/sys/windows/ntdll.d
+++ b/libphobos/libdruntime/core/sys/windows/ntdll.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.ntdll;
version (Windows):
-@system:
import core.sys.windows.w32api;
diff --git a/libphobos/libdruntime/core/sys/windows/ntldap.d b/libphobos/libdruntime/core/sys/windows/ntldap.d
index 52cadde..8f9abfe 100644
--- a/libphobos/libdruntime/core/sys/windows/ntldap.d
+++ b/libphobos/libdruntime/core/sys/windows/ntldap.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.ntldap;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/ntsecapi.d b/libphobos/libdruntime/core/sys/windows/ntsecapi.d
index 1118057..fbc6b7f 100644
--- a/libphobos/libdruntime/core/sys/windows/ntsecapi.d
+++ b/libphobos/libdruntime/core/sys/windows/ntsecapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.ntsecapi;
version (Windows):
-@system:
pragma(lib, "advapi32");
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/ntsecpkg.d b/libphobos/libdruntime/core/sys/windows/ntsecpkg.d
index d8c5e95..56803b0 100644
--- a/libphobos/libdruntime/core/sys/windows/ntsecpkg.d
+++ b/libphobos/libdruntime/core/sys/windows/ntsecpkg.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.ntsecpkg;
version (Windows):
-@system:
import core.sys.windows.windef, core.sys.windows.ntsecapi, core.sys.windows.security, core.sys.windows.ntdef, core.sys.windows.sspi;
import core.sys.windows.basetyps : GUID;
diff --git a/libphobos/libdruntime/core/sys/windows/oaidl.d b/libphobos/libdruntime/core/sys/windows/oaidl.d
index 6c93682..cd11061 100644
--- a/libphobos/libdruntime/core/sys/windows/oaidl.d
+++ b/libphobos/libdruntime/core/sys/windows/oaidl.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.oaidl;
version (Windows):
-@system:
import core.sys.windows.basetyps, core.sys.windows.unknwn, core.sys.windows.windef, core.sys.windows.wtypes;
diff --git a/libphobos/libdruntime/core/sys/windows/objbase.d b/libphobos/libdruntime/core/sys/windows/objbase.d
index bb9e7ea..350c2b8 100644
--- a/libphobos/libdruntime/core/sys/windows/objbase.d
+++ b/libphobos/libdruntime/core/sys/windows/objbase.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.objbase;
version (Windows):
-@system:
nothrow:
pragma(lib, "ole32");
diff --git a/libphobos/libdruntime/core/sys/windows/objfwd.d b/libphobos/libdruntime/core/sys/windows/objfwd.d
index 89d5cad..076e02e 100644
--- a/libphobos/libdruntime/core/sys/windows/objfwd.d
+++ b/libphobos/libdruntime/core/sys/windows/objfwd.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.objfwd;
version (Windows):
-@system:
import core.sys.windows.objidl;
diff --git a/libphobos/libdruntime/core/sys/windows/objidl.d b/libphobos/libdruntime/core/sys/windows/objidl.d
index 528c58b..aa51840 100644
--- a/libphobos/libdruntime/core/sys/windows/objidl.d
+++ b/libphobos/libdruntime/core/sys/windows/objidl.d
@@ -12,7 +12,6 @@
// # do we need the proxies that are defined in this file?
module core.sys.windows.objidl;
version (Windows):
-@system:
import core.sys.windows.unknwn;
import core.sys.windows.objfwd;
diff --git a/libphobos/libdruntime/core/sys/windows/objsafe.d b/libphobos/libdruntime/core/sys/windows/objsafe.d
index 449a4c3..f7dc445 100644
--- a/libphobos/libdruntime/core/sys/windows/objsafe.d
+++ b/libphobos/libdruntime/core/sys/windows/objsafe.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.objsafe;
version (Windows):
-@system:
import core.sys.windows.basetyps, core.sys.windows.unknwn, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/ocidl.d b/libphobos/libdruntime/core/sys/windows/ocidl.d
index af42bea..9bacbf0 100644
--- a/libphobos/libdruntime/core/sys/windows/ocidl.d
+++ b/libphobos/libdruntime/core/sys/windows/ocidl.d
@@ -10,7 +10,6 @@
*/
module core.sys.windows.ocidl;
version (Windows):
-@system:
import core.sys.windows.ole2, core.sys.windows.oleidl, core.sys.windows.oaidl, core.sys.windows.objfwd,
core.sys.windows.windef, core.sys.windows.wtypes;
diff --git a/libphobos/libdruntime/core/sys/windows/odbcinst.d b/libphobos/libdruntime/core/sys/windows/odbcinst.d
index b0ca42a..ebacb58 100644
--- a/libphobos/libdruntime/core/sys/windows/odbcinst.d
+++ b/libphobos/libdruntime/core/sys/windows/odbcinst.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.odbcinst;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/ole.d b/libphobos/libdruntime/core/sys/windows/ole.d
index 21218f1..c29ec50 100644
--- a/libphobos/libdruntime/core/sys/windows/ole.d
+++ b/libphobos/libdruntime/core/sys/windows/ole.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.ole;
version (Windows):
-@system:
pragma(lib, "ole32");
import core.sys.windows.windef, core.sys.windows.wingdi, core.sys.windows.uuid;
diff --git a/libphobos/libdruntime/core/sys/windows/ole2.d b/libphobos/libdruntime/core/sys/windows/ole2.d
index 0945fca..3fef058 100644
--- a/libphobos/libdruntime/core/sys/windows/ole2.d
+++ b/libphobos/libdruntime/core/sys/windows/ole2.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.ole2;
version (Windows):
-@system:
pragma(lib, "ole32");
public import core.sys.windows.basetyps, core.sys.windows.objbase, core.sys.windows.oleauto, core.sys.windows.olectlid,
diff --git a/libphobos/libdruntime/core/sys/windows/oleacc.d b/libphobos/libdruntime/core/sys/windows/oleacc.d
index 77137c6..b19855d 100644
--- a/libphobos/libdruntime/core/sys/windows/oleacc.d
+++ b/libphobos/libdruntime/core/sys/windows/oleacc.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.oleacc;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "oleacc");
diff --git a/libphobos/libdruntime/core/sys/windows/oleauto.d b/libphobos/libdruntime/core/sys/windows/oleauto.d
index f8d76e1..1888136 100644
--- a/libphobos/libdruntime/core/sys/windows/oleauto.d
+++ b/libphobos/libdruntime/core/sys/windows/oleauto.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.oleauto;
version (Windows):
-@system:
pragma(lib, "oleaut32");
import core.sys.windows.oaidl;
diff --git a/libphobos/libdruntime/core/sys/windows/olectl.d b/libphobos/libdruntime/core/sys/windows/olectl.d
index f671ce4..df8266b 100644
--- a/libphobos/libdruntime/core/sys/windows/olectl.d
+++ b/libphobos/libdruntime/core/sys/windows/olectl.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.olectl;
version (Windows):
-@system:
// In conversion from MinGW, the following was deleted:
//#define FONTSIZE(n) {n##0000, 0}
diff --git a/libphobos/libdruntime/core/sys/windows/oledlg.d b/libphobos/libdruntime/core/sys/windows/oledlg.d
index f1a0510..f810f6c 100644
--- a/libphobos/libdruntime/core/sys/windows/oledlg.d
+++ b/libphobos/libdruntime/core/sys/windows/oledlg.d
@@ -7,7 +7,6 @@
* Source: $(DRUNTIMESRC core/sys/windows/_oledlg.d)
*/
module core.sys.windows.oledlg;
-@system:
version (Windows):
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/oleidl.d b/libphobos/libdruntime/core/sys/windows/oleidl.d
index 4ef564d..17e1d64 100644
--- a/libphobos/libdruntime/core/sys/windows/oleidl.d
+++ b/libphobos/libdruntime/core/sys/windows/oleidl.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.oleidl;
version (Windows):
-@system:
// DAC: This is defined in ocidl !!
// what is it doing in here?
diff --git a/libphobos/libdruntime/core/sys/windows/pbt.d b/libphobos/libdruntime/core/sys/windows/pbt.d
index 3b65ba5..2689884 100644
--- a/libphobos/libdruntime/core/sys/windows/pbt.d
+++ b/libphobos/libdruntime/core/sys/windows/pbt.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.pbt;
version (Windows):
-@system:
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/powrprof.d b/libphobos/libdruntime/core/sys/windows/powrprof.d
index 275dbea..be4d0aa 100644
--- a/libphobos/libdruntime/core/sys/windows/powrprof.d
+++ b/libphobos/libdruntime/core/sys/windows/powrprof.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.powrprof;
version (Windows):
-@system:
pragma(lib, "powrprof");
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/prsht.d b/libphobos/libdruntime/core/sys/windows/prsht.d
index ba04b57..92596b5 100644
--- a/libphobos/libdruntime/core/sys/windows/prsht.d
+++ b/libphobos/libdruntime/core/sys/windows/prsht.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.prsht;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "comctl32");
diff --git a/libphobos/libdruntime/core/sys/windows/psapi.d b/libphobos/libdruntime/core/sys/windows/psapi.d
index 585f908..968ce6c 100644
--- a/libphobos/libdruntime/core/sys/windows/psapi.d
+++ b/libphobos/libdruntime/core/sys/windows/psapi.d
@@ -13,7 +13,6 @@
module core.sys.windows.psapi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/rapi.d b/libphobos/libdruntime/core/sys/windows/rapi.d
index 086b7a6..2fc6404 100644
--- a/libphobos/libdruntime/core/sys/windows/rapi.d
+++ b/libphobos/libdruntime/core/sys/windows/rapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.rapi;
version (Windows):
-@system:
/* Comment from MinGW
NOTE: This strictly does not belong in the Win32 API since it's
diff --git a/libphobos/libdruntime/core/sys/windows/ras.d b/libphobos/libdruntime/core/sys/windows/ras.d
index 1f66546..cb69686 100644
--- a/libphobos/libdruntime/core/sys/windows/ras.d
+++ b/libphobos/libdruntime/core/sys/windows/ras.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.ras;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "rasapi32");
diff --git a/libphobos/libdruntime/core/sys/windows/rasdlg.d b/libphobos/libdruntime/core/sys/windows/rasdlg.d
index 1add3ae..a980d27 100644
--- a/libphobos/libdruntime/core/sys/windows/rasdlg.d
+++ b/libphobos/libdruntime/core/sys/windows/rasdlg.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.rasdlg;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/raserror.d b/libphobos/libdruntime/core/sys/windows/raserror.d
index c21409b..48a2756 100644
--- a/libphobos/libdruntime/core/sys/windows/raserror.d
+++ b/libphobos/libdruntime/core/sys/windows/raserror.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.raserror;
version (Windows):
-@system:
enum {
SUCCESS = 0,
diff --git a/libphobos/libdruntime/core/sys/windows/rassapi.d b/libphobos/libdruntime/core/sys/windows/rassapi.d
index aed14f1..5244ca4 100644
--- a/libphobos/libdruntime/core/sys/windows/rassapi.d
+++ b/libphobos/libdruntime/core/sys/windows/rassapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.rassapi;
version (Windows):
-@system:
import core.sys.windows.lmcons, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/reason.d b/libphobos/libdruntime/core/sys/windows/reason.d
index 4274efa..e1fb1ca 100644
--- a/libphobos/libdruntime/core/sys/windows/reason.d
+++ b/libphobos/libdruntime/core/sys/windows/reason.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.reason;
version (Windows):
-@system:
import core.sys.windows.w32api, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/regstr.d b/libphobos/libdruntime/core/sys/windows/regstr.d
index 71a86ef..f8851fa 100644
--- a/libphobos/libdruntime/core/sys/windows/regstr.d
+++ b/libphobos/libdruntime/core/sys/windows/regstr.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.regstr;
version (Windows):
-@system:
// TODO: fix possible conflict with shloj. Sort out NEC_98 issue.
diff --git a/libphobos/libdruntime/core/sys/windows/richedit.d b/libphobos/libdruntime/core/sys/windows/richedit.d
index 6760764..0f56fef 100644
--- a/libphobos/libdruntime/core/sys/windows/richedit.d
+++ b/libphobos/libdruntime/core/sys/windows/richedit.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.richedit;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/richole.d b/libphobos/libdruntime/core/sys/windows/richole.d
index 288ef22..0151818 100644
--- a/libphobos/libdruntime/core/sys/windows/richole.d
+++ b/libphobos/libdruntime/core/sys/windows/richole.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.richole;
version (Windows):
-@system:
import core.sys.windows.objfwd, core.sys.windows.objidl, core.sys.windows.ole2, core.sys.windows.unknwn,
core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/rpc.d b/libphobos/libdruntime/core/sys/windows/rpc.d
index a9640ad..b432bc7 100644
--- a/libphobos/libdruntime/core/sys/windows/rpc.d
+++ b/libphobos/libdruntime/core/sys/windows/rpc.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.rpc;
version (Windows):
-@system:
/* Moved to rpcdecp (duplicate definition).
typedef void *I_RPC_HANDLE;
diff --git a/libphobos/libdruntime/core/sys/windows/rpcdce.d b/libphobos/libdruntime/core/sys/windows/rpcdce.d
index 1eccb0d..4f3f3cc 100644
--- a/libphobos/libdruntime/core/sys/windows/rpcdce.d
+++ b/libphobos/libdruntime/core/sys/windows/rpcdce.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.rpcdce;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "Rpcrt4");
diff --git a/libphobos/libdruntime/core/sys/windows/rpcdce2.d b/libphobos/libdruntime/core/sys/windows/rpcdce2.d
index c8223f6..08348c0 100644
--- a/libphobos/libdruntime/core/sys/windows/rpcdce2.d
+++ b/libphobos/libdruntime/core/sys/windows/rpcdce2.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.rpcdce2;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/rpcdcep.d b/libphobos/libdruntime/core/sys/windows/rpcdcep.d
index 1abbb78..cebe981 100644
--- a/libphobos/libdruntime/core/sys/windows/rpcdcep.d
+++ b/libphobos/libdruntime/core/sys/windows/rpcdcep.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.rpcdcep;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/rpcndr.d b/libphobos/libdruntime/core/sys/windows/rpcndr.d
index 6e9722c..127d88b 100644
--- a/libphobos/libdruntime/core/sys/windows/rpcndr.d
+++ b/libphobos/libdruntime/core/sys/windows/rpcndr.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.rpcndr;
version (Windows):
-@system:
pragma(lib, "rpcrt4");
/* Translation notes:
diff --git a/libphobos/libdruntime/core/sys/windows/rpcnsi.d b/libphobos/libdruntime/core/sys/windows/rpcnsi.d
index 608b92c..1294d0d 100644
--- a/libphobos/libdruntime/core/sys/windows/rpcnsi.d
+++ b/libphobos/libdruntime/core/sys/windows/rpcnsi.d
@@ -10,7 +10,6 @@
*/
module core.sys.windows.rpcnsi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "rpcns4");
diff --git a/libphobos/libdruntime/core/sys/windows/rpcnsip.d b/libphobos/libdruntime/core/sys/windows/rpcnsip.d
index 219d7b0..ccf026f 100644
--- a/libphobos/libdruntime/core/sys/windows/rpcnsip.d
+++ b/libphobos/libdruntime/core/sys/windows/rpcnsip.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.rpcnsip;
version (Windows):
-@system:
import core.sys.windows.rpcdce, core.sys.windows.rpcdcep, core.sys.windows.rpcnsi;
diff --git a/libphobos/libdruntime/core/sys/windows/rpcnterr.d b/libphobos/libdruntime/core/sys/windows/rpcnterr.d
index 426077a..bbead74 100644
--- a/libphobos/libdruntime/core/sys/windows/rpcnterr.d
+++ b/libphobos/libdruntime/core/sys/windows/rpcnterr.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.rpcnterr;
version (Windows):
-@system:
import core.sys.windows.winerror;
diff --git a/libphobos/libdruntime/core/sys/windows/schannel.d b/libphobos/libdruntime/core/sys/windows/schannel.d
index 98c5cf8..6ffab30 100644
--- a/libphobos/libdruntime/core/sys/windows/schannel.d
+++ b/libphobos/libdruntime/core/sys/windows/schannel.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.schannel;
version (Windows):
-@system:
import core.sys.windows.wincrypt;
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/sdkddkver.d b/libphobos/libdruntime/core/sys/windows/sdkddkver.d
index 4b5bad5..3f5c01b 100644
--- a/libphobos/libdruntime/core/sys/windows/sdkddkver.d
+++ b/libphobos/libdruntime/core/sys/windows/sdkddkver.d
@@ -9,7 +9,6 @@
module core.sys.windows.sdkddkver;
version (Windows):
-@system:
enum _WIN32_WINNT_NT4 = 0x0400;
enum _WIN32_WINNT_WIN2K = 0x0500;
diff --git a/libphobos/libdruntime/core/sys/windows/secext.d b/libphobos/libdruntime/core/sys/windows/secext.d
index 6b92fcd..ab61536 100644
--- a/libphobos/libdruntime/core/sys/windows/secext.d
+++ b/libphobos/libdruntime/core/sys/windows/secext.d
@@ -9,7 +9,6 @@
// Don't include this file directly, use core.sys.windows.security instead.
module core.sys.windows.secext;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "secur32");
diff --git a/libphobos/libdruntime/core/sys/windows/security.d b/libphobos/libdruntime/core/sys/windows/security.d
index b81abb3..f93dc81 100644
--- a/libphobos/libdruntime/core/sys/windows/security.d
+++ b/libphobos/libdruntime/core/sys/windows/security.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.security;
version (Windows):
-@system:
enum : SECURITY_STATUS
{
diff --git a/libphobos/libdruntime/core/sys/windows/servprov.d b/libphobos/libdruntime/core/sys/windows/servprov.d
index 89ab47c..ae8bef1 100644
--- a/libphobos/libdruntime/core/sys/windows/servprov.d
+++ b/libphobos/libdruntime/core/sys/windows/servprov.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.servprov;
version (Windows):
-@system:
import core.sys.windows.basetyps, core.sys.windows.unknwn, core.sys.windows.windef, core.sys.windows.wtypes;
diff --git a/libphobos/libdruntime/core/sys/windows/setupapi.d b/libphobos/libdruntime/core/sys/windows/setupapi.d
index 80e8dba..7a052cd 100644
--- a/libphobos/libdruntime/core/sys/windows/setupapi.d
+++ b/libphobos/libdruntime/core/sys/windows/setupapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.setupapi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "setupapi");
diff --git a/libphobos/libdruntime/core/sys/windows/shellapi.d b/libphobos/libdruntime/core/sys/windows/shellapi.d
index f401997..fdd9938 100644
--- a/libphobos/libdruntime/core/sys/windows/shellapi.d
+++ b/libphobos/libdruntime/core/sys/windows/shellapi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.shellapi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "shell32");
diff --git a/libphobos/libdruntime/core/sys/windows/shldisp.d b/libphobos/libdruntime/core/sys/windows/shldisp.d
index ecb0ede..144f907 100644
--- a/libphobos/libdruntime/core/sys/windows/shldisp.d
+++ b/libphobos/libdruntime/core/sys/windows/shldisp.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.shldisp;
version (Windows):
-@system:
import core.sys.windows.unknwn, core.sys.windows.windef, core.sys.windows.wtypes;
diff --git a/libphobos/libdruntime/core/sys/windows/shlguid.d b/libphobos/libdruntime/core/sys/windows/shlguid.d
index e0c1af1..f4c73ef 100644
--- a/libphobos/libdruntime/core/sys/windows/shlguid.d
+++ b/libphobos/libdruntime/core/sys/windows/shlguid.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.shlguid;
version (Windows):
-@system:
import core.sys.windows.basetyps, core.sys.windows.w32api;
diff --git a/libphobos/libdruntime/core/sys/windows/shlobj.d b/libphobos/libdruntime/core/sys/windows/shlobj.d
index 75ac622..bcd254b 100644
--- a/libphobos/libdruntime/core/sys/windows/shlobj.d
+++ b/libphobos/libdruntime/core/sys/windows/shlobj.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.shlobj;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "shell32");
diff --git a/libphobos/libdruntime/core/sys/windows/shlwapi.d b/libphobos/libdruntime/core/sys/windows/shlwapi.d
index d1a61a3..cfabbad 100644
--- a/libphobos/libdruntime/core/sys/windows/shlwapi.d
+++ b/libphobos/libdruntime/core/sys/windows/shlwapi.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.shlwapi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "shlwapi");
diff --git a/libphobos/libdruntime/core/sys/windows/snmp.d b/libphobos/libdruntime/core/sys/windows/snmp.d
index bf56b28..62c81e1 100644
--- a/libphobos/libdruntime/core/sys/windows/snmp.d
+++ b/libphobos/libdruntime/core/sys/windows/snmp.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.snmp;
version (Windows):
-@system:
import core.sys.windows.basetsd /+: HANDLE+/;
import core.sys.windows.windef /+: BOOL, BYTE, DWORD, INT, LONG, UINT, ULONG+/;
diff --git a/libphobos/libdruntime/core/sys/windows/sql.d b/libphobos/libdruntime/core/sys/windows/sql.d
index 7c8758e..58c6d42 100644
--- a/libphobos/libdruntime/core/sys/windows/sql.d
+++ b/libphobos/libdruntime/core/sys/windows/sql.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.sql;
version (Windows):
-@system:
public import core.sys.windows.sqltypes;
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/sqlext.d b/libphobos/libdruntime/core/sys/windows/sqlext.d
index 2ddff20..8702cda 100644
--- a/libphobos/libdruntime/core/sys/windows/sqlext.d
+++ b/libphobos/libdruntime/core/sys/windows/sqlext.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.sqlext;
version (Windows):
-@system:
/* Conversion notes:
The MinGW file was a horrible mess. All of the #defines were sorted alphabetically,
diff --git a/libphobos/libdruntime/core/sys/windows/sqltypes.d b/libphobos/libdruntime/core/sys/windows/sqltypes.d
index fd77b81..28d5f5d 100644
--- a/libphobos/libdruntime/core/sys/windows/sqltypes.d
+++ b/libphobos/libdruntime/core/sys/windows/sqltypes.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.sqltypes;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/sqlucode.d b/libphobos/libdruntime/core/sys/windows/sqlucode.d
index 85f0d06..d4f03f6 100644
--- a/libphobos/libdruntime/core/sys/windows/sqlucode.d
+++ b/libphobos/libdruntime/core/sys/windows/sqlucode.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.sqlucode;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/sspi.d b/libphobos/libdruntime/core/sys/windows/sspi.d
index 21e982d..3686c6f 100644
--- a/libphobos/libdruntime/core/sys/windows/sspi.d
+++ b/libphobos/libdruntime/core/sys/windows/sspi.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.sspi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/stacktrace.d b/libphobos/libdruntime/core/sys/windows/stacktrace.d
index 2922e54..c10a917 100644
--- a/libphobos/libdruntime/core/sys/windows/stacktrace.d
+++ b/libphobos/libdruntime/core/sys/windows/stacktrace.d
@@ -11,7 +11,6 @@
module core.sys.windows.stacktrace;
version (Windows):
-@system:
import core.demangle;
import core.stdc.stdlib;
@@ -25,12 +24,13 @@ import core.sys.windows.windef;
debug(PRINTF) import core.stdc.stdio;
-extern(Windows) void RtlCaptureContext(CONTEXT* ContextRecord);
+extern(Windows) void RtlCaptureContext(CONTEXT* ContextRecord) @nogc;
extern(Windows) DWORD GetEnvironmentVariableA(LPCSTR lpName, LPSTR pBuffer, DWORD nSize);
-extern(Windows) alias USHORT function(ULONG FramesToSkip, ULONG FramesToCapture, PVOID *BackTrace, PULONG BackTraceHash) RtlCaptureStackBackTraceFunc;
+extern(Windows) alias USHORT function(ULONG FramesToSkip, ULONG FramesToCapture, PVOID *BackTrace, PULONG BackTraceHash) @nogc RtlCaptureStackBackTraceFunc;
private __gshared RtlCaptureStackBackTraceFunc RtlCaptureStackBackTrace;
+private __gshared CRITICAL_SECTION mutex; // cannot use core.sync.mutex.Mutex unfortunately (cyclic dependency...)
private __gshared immutable bool initialized;
@@ -43,7 +43,7 @@ public:
* skip = The number of stack frames to skip.
* context = The context to receive the stack trace from. Can be null.
*/
- this(size_t skip, CONTEXT* context)
+ this(size_t skip, CONTEXT* context) @nogc
{
if (context is null)
{
@@ -64,11 +64,11 @@ public:
skip += INTERNALFRAMES;
}
- if ( initialized )
- m_trace = trace(skip, context);
+ if (initialized)
+ m_trace = trace(tracebuf[], skip, context);
}
- int opApply( scope int delegate(ref const(char[])) dg ) const
+ override int opApply( scope int delegate(ref const(char[])) dg ) const
{
return opApply( (ref size_t, ref const(char[]) buf)
{
@@ -77,7 +77,7 @@ public:
}
- int opApply( scope int delegate(ref size_t, ref const(char[])) dg ) const
+ override int opApply( scope int delegate(ref size_t, ref const(char[])) dg ) const
{
int result;
foreach ( i, e; resolve(m_trace) )
@@ -101,19 +101,28 @@ public:
}
/**
- * Receive a stack trace in the form of an address list.
+ * Receive a stack trace in the form of an address list. One form accepts
+ * an allocated buffer, the other form automatically allocates the buffer.
+ *
* Params:
* skip = How many stack frames should be skipped.
* context = The context that should be used. If null the current context is used.
+ * buffer = The buffer to use for the trace. This should be at least 63 elements.
* Returns:
* A list of addresses that can be passed to resolve at a later point in time.
*/
static ulong[] trace(size_t skip = 0, CONTEXT* context = null)
{
- synchronized( typeid(StackTrace) )
- {
- return traceNoSync(skip, context);
- }
+ return trace(new ulong[63], skip, context);
+ }
+
+ /// ditto
+ static ulong[] trace(ulong[] buffer, size_t skip = 0, CONTEXT* context = null) @nogc
+ {
+ EnterCriticalSection(&mutex);
+ scope(exit) LeaveCriticalSection(&mutex);
+
+ return traceNoSync(buffer, skip, context);
}
/**
@@ -125,45 +134,55 @@ public:
*/
@trusted static char[][] resolve(const(ulong)[] addresses)
{
- synchronized( typeid(StackTrace) )
- {
- return resolveNoSync(addresses);
- }
+ // FIXME: make @nogc to avoid having to disable resolution within finalizers
+ import core.memory : GC;
+ if (GC.inFinalizer)
+ return null;
+
+ EnterCriticalSection(&mutex);
+ scope(exit) LeaveCriticalSection(&mutex);
+
+ return resolveNoSync(addresses);
}
private:
+ ulong[128] tracebuf;
ulong[] m_trace;
- static ulong[] traceNoSync(size_t skip, CONTEXT* context)
+ static ulong[] traceNoSync(ulong[] buffer, size_t skip, CONTEXT* context) @nogc
{
auto dbghelp = DbgHelp.get();
if (dbghelp is null)
return []; // dbghelp.dll not available
- if (RtlCaptureStackBackTrace !is null && context is null)
+ if (buffer.length >= 63 && RtlCaptureStackBackTrace !is null &&
+ context is null)
{
- size_t[63] buffer = void; // On windows xp the sum of "frames to skip" and "frames to capture" can't be greater then 63
- auto backtraceLength = RtlCaptureStackBackTrace(cast(ULONG)skip, cast(ULONG)(buffer.length - skip), cast(void**)buffer.ptr, null);
+ version (Win64)
+ {
+ auto bufptr = cast(void**)buffer.ptr;
+ }
+ version (Win32)
+ {
+ size_t[63] bufstorage = void; // On windows xp the sum of "frames to skip" and "frames to capture" can't be greater then 63
+ auto bufptr = cast(void**)bufstorage.ptr;
+ }
+ auto backtraceLength = RtlCaptureStackBackTrace(cast(ULONG)skip, cast(ULONG)(63 - skip), bufptr, null);
// If we get a backtrace and it does not have the maximum length use it.
// Otherwise rely on tracing through StackWalk64 which is slower but works when no frame pointers are available.
- if (backtraceLength > 1 && backtraceLength < buffer.length - skip)
+ if (backtraceLength > 1 && backtraceLength < 63 - skip)
{
debug(PRINTF) printf("Using result from RtlCaptureStackBackTrace\n");
- version (Win64)
- {
- return buffer[0..backtraceLength].dup;
- }
- else version (Win32)
+ version (Win32)
{
- auto result = new ulong[backtraceLength];
- foreach (i, ref e; result)
+ foreach (i, ref e; buffer[0 .. backtraceLength])
{
- e = buffer[i];
+ e = bufstorage[i];
}
- return result;
}
+ return buffer[0..backtraceLength];
}
}
@@ -211,21 +230,21 @@ private:
else version (X86_64) enum imageType = IMAGE_FILE_MACHINE_AMD64;
else static assert(0, "unimplemented");
- ulong[] result;
size_t frameNum = 0;
+ size_t nframes = 0;
// do ... while so that we don't skip the first stackframe
do
{
if (frameNum >= skip)
{
- result ~= stackframe.AddrPC.Offset;
+ buffer[nframes++] = stackframe.AddrPC.Offset;
}
frameNum++;
}
while (dbghelp.StackWalk64(imageType, hProcess, hThread, &stackframe,
&ctxt, null, null, null, null));
- return result;
+ return buffer[0 .. nframes];
}
static char[][] resolveNoSync(const(ulong)[] addresses)
@@ -288,7 +307,8 @@ private:
auto res = formatStackFrame(pc);
res ~= " in ";
const(char)[] tempSymName = symName[0 .. strlen(symName)];
- //Deal with dmd mangling of long names
+ // Deal with dmd mangling of long names for OMF 32 bits builds
+ // Note that `target.d` only defines `CRuntime_DigitalMars` for OMF builds
version (CRuntime_DigitalMars)
{
size_t decodeIndex = 0;
@@ -407,5 +427,6 @@ shared static this()
dbghelp.SymRegisterCallback64(hProcess, &FixupDebugHeader, 0);
+ InitializeCriticalSection(&mutex);
initialized = true;
}
diff --git a/libphobos/libdruntime/core/sys/windows/stat.d b/libphobos/libdruntime/core/sys/windows/stat.d
index 16f66e1..c87c749 100644
--- a/libphobos/libdruntime/core/sys/windows/stat.d
+++ b/libphobos/libdruntime/core/sys/windows/stat.d
@@ -6,7 +6,6 @@ module core.sys.windows.stat;
version (Windows):
extern (C) nothrow @nogc:
-@system:
import core.sys.windows.stdc.time;
diff --git a/libphobos/libdruntime/core/sys/windows/stdc/malloc.d b/libphobos/libdruntime/core/sys/windows/stdc/malloc.d
index 278c9fe..768102c 100644
--- a/libphobos/libdruntime/core/sys/windows/stdc/malloc.d
+++ b/libphobos/libdruntime/core/sys/windows/stdc/malloc.d
@@ -10,7 +10,6 @@
module core.sys.windows.stdc.malloc;
version (CRuntime_Microsoft):
extern (C):
-@system:
nothrow:
@nogc:
diff --git a/libphobos/libdruntime/core/sys/windows/subauth.d b/libphobos/libdruntime/core/sys/windows/subauth.d
index e0d67ff..a48fb99 100644
--- a/libphobos/libdruntime/core/sys/windows/subauth.d
+++ b/libphobos/libdruntime/core/sys/windows/subauth.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.subauth;
version (Windows):
-@system:
import core.sys.windows.ntdef, core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/sys/windows/threadaux.d b/libphobos/libdruntime/core/sys/windows/threadaux.d
index 34fda65..92bd1c6 100644
--- a/libphobos/libdruntime/core/sys/windows/threadaux.d
+++ b/libphobos/libdruntime/core/sys/windows/threadaux.d
@@ -14,7 +14,6 @@
*/
module core.sys.windows.threadaux;
version (Windows):
-@system:
import core.sys.windows.basetsd/+ : HANDLE+/;
import core.sys.windows.winbase/+ : CloseHandle, GetCurrentThreadId, GetCurrentProcessId,
diff --git a/libphobos/libdruntime/core/sys/windows/tlhelp32.d b/libphobos/libdruntime/core/sys/windows/tlhelp32.d
index 34ed101..ecbfe38 100644
--- a/libphobos/libdruntime/core/sys/windows/tlhelp32.d
+++ b/libphobos/libdruntime/core/sys/windows/tlhelp32.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.tlhelp32;
version (Windows):
-@system:
pragma(lib, "kernel32");
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/tmschema.d b/libphobos/libdruntime/core/sys/windows/tmschema.d
index b82dc5c..7bca878 100644
--- a/libphobos/libdruntime/core/sys/windows/tmschema.d
+++ b/libphobos/libdruntime/core/sys/windows/tmschema.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.tmschema;
version (Windows):
-@system:
/* BUTTON parts */
enum {
diff --git a/libphobos/libdruntime/core/sys/windows/unknwn.d b/libphobos/libdruntime/core/sys/windows/unknwn.d
index 6db1db8..0b00279 100644
--- a/libphobos/libdruntime/core/sys/windows/unknwn.d
+++ b/libphobos/libdruntime/core/sys/windows/unknwn.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.unknwn;
version (Windows):
-@system:
nothrow:
import core.sys.windows.objfwd, core.sys.windows.windef, core.sys.windows.wtypes;
diff --git a/libphobos/libdruntime/core/sys/windows/uuid.d b/libphobos/libdruntime/core/sys/windows/uuid.d
index 7e8d4b9..d3b979d 100644
--- a/libphobos/libdruntime/core/sys/windows/uuid.d
+++ b/libphobos/libdruntime/core/sys/windows/uuid.d
@@ -1,6 +1,5 @@
module core.sys.windows.uuid;
version (Windows):
-@system:
import core.sys.windows.basetyps;
diff --git a/libphobos/libdruntime/core/sys/windows/vfw.d b/libphobos/libdruntime/core/sys/windows/vfw.d
index c67753a..ebe0ed0 100644
--- a/libphobos/libdruntime/core/sys/windows/vfw.d
+++ b/libphobos/libdruntime/core/sys/windows/vfw.d
@@ -9,7 +9,6 @@
module core.sys.windows.vfw;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "vfw32");
diff --git a/libphobos/libdruntime/core/sys/windows/w32api.d b/libphobos/libdruntime/core/sys/windows/w32api.d
index 2752da1..5a8a59b 100644
--- a/libphobos/libdruntime/core/sys/windows/w32api.d
+++ b/libphobos/libdruntime/core/sys/windows/w32api.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.w32api;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/winbase.d b/libphobos/libdruntime/core/sys/windows/winbase.d
index 1806796..bbb6e9a 100644
--- a/libphobos/libdruntime/core/sys/windows/winbase.d
+++ b/libphobos/libdruntime/core/sys/windows/winbase.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.winbase;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "kernel32");
@@ -39,6 +38,7 @@ import core.sys.windows.basetyps, core.sys.windows.w32api, core.sys.windows.winn
// FIXME:
//alias void va_list;
import core.stdc.stdarg : va_list;
+import core.stdc.string : memset, memcpy, memmove;
// COMMPROP structure, used by GetCommProperties()
@@ -1714,23 +1714,15 @@ extern (Windows) nothrow @nogc {
BOOL CopyFileExA(LPCSTR, LPCSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD);
BOOL CopyFileExW(LPCWSTR, LPCWSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD);
- /+ FIXME
- alias memmove RtlMoveMemory;
- alias memcpy RtlCopyMemory;
+ alias RtlMoveMemory = memmove;
+ alias RtlCopyMemory = memcpy;
+ pragma(inline, true) void RtlFillMemory(PVOID Destination, SIZE_T Length, BYTE Fill) { memset(Destination, Fill, Length); }
+ pragma(inline, true) void RtlZeroMemory(PVOID Destination, SIZE_T Length) { memset(Destination, 0, Length); }
+ alias MoveMemory = RtlMoveMemory;
+ alias CopyMemory = RtlCopyMemory;
+ alias FillMemory = RtlFillMemory;
+ alias ZeroMemory = RtlZeroMemory;
- void RtlFillMemory(PVOID dest, SIZE_T len, BYTE fill) {
- memset(dest, fill, len);
- }
-
- void RtlZeroMemory(PVOID dest, SIZE_T len) {
- RtlFillMemory(dest, len, 0);
- }
-
- alias RtlMoveMemory MoveMemory;
- alias RtlCopyMemory CopyMemory;
- alias RtlFillMemory FillMemory;
- alias RtlZeroMemory ZeroMemory;
- +/
BOOL CreateDirectoryA(LPCSTR, LPSECURITY_ATTRIBUTES);
BOOL CreateDirectoryW(LPCWSTR, LPSECURITY_ATTRIBUTES);
BOOL CreateDirectoryExA(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
diff --git a/libphobos/libdruntime/core/sys/windows/winber.d b/libphobos/libdruntime/core/sys/windows/winber.d
index d6a79cd..b211938 100644
--- a/libphobos/libdruntime/core/sys/windows/winber.d
+++ b/libphobos/libdruntime/core/sys/windows/winber.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.winber;
version (Windows):
-@system:
/* Comment from MinGW
winber.h - Header file for the Windows LDAP Basic Encoding Rules API
diff --git a/libphobos/libdruntime/core/sys/windows/wincon.d b/libphobos/libdruntime/core/sys/windows/wincon.d
index a404c5c..a00ba2e3 100644
--- a/libphobos/libdruntime/core/sys/windows/wincon.d
+++ b/libphobos/libdruntime/core/sys/windows/wincon.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.wincon;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "kernel32");
diff --git a/libphobos/libdruntime/core/sys/windows/wincrypt.d b/libphobos/libdruntime/core/sys/windows/wincrypt.d
index d6c617d2..cb52d9e 100644
--- a/libphobos/libdruntime/core/sys/windows/wincrypt.d
+++ b/libphobos/libdruntime/core/sys/windows/wincrypt.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.wincrypt;
version (Windows):
-@system:
pragma(lib, "advapi32");
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/windef.d b/libphobos/libdruntime/core/sys/windows/windef.d
index 31af66a..4e951f3 100644
--- a/libphobos/libdruntime/core/sys/windows/windef.d
+++ b/libphobos/libdruntime/core/sys/windows/windef.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.windef;
version (Windows):
-@system:
public import core.sys.windows.winnt;
import core.sys.windows.w32api;
diff --git a/libphobos/libdruntime/core/sys/windows/windows.d b/libphobos/libdruntime/core/sys/windows/windows.d
index 4a1b02f..a289fb1 100644
--- a/libphobos/libdruntime/core/sys/windows/windows.d
+++ b/libphobos/libdruntime/core/sys/windows/windows.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.windows;
version (Windows):
-@system:
/*
windows.h - main header file for the Win32 API
diff --git a/libphobos/libdruntime/core/sys/windows/winerror.d b/libphobos/libdruntime/core/sys/windows/winerror.d
index a26b05c..865319b 100644
--- a/libphobos/libdruntime/core/sys/windows/winerror.d
+++ b/libphobos/libdruntime/core/sys/windows/winerror.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.winerror;
version (Windows):
-@system:
/* Comments from the Mingw header:
* WAIT_TIMEOUT is also defined in winbase.h
diff --git a/libphobos/libdruntime/core/sys/windows/wingdi.d b/libphobos/libdruntime/core/sys/windows/wingdi.d
index ba45c27..5a4eeaa 100644
--- a/libphobos/libdruntime/core/sys/windows/wingdi.d
+++ b/libphobos/libdruntime/core/sys/windows/wingdi.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.wingdi;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "gdi32");
diff --git a/libphobos/libdruntime/core/sys/windows/winhttp.d b/libphobos/libdruntime/core/sys/windows/winhttp.d
index f665805..63d59cb 100644
--- a/libphobos/libdruntime/core/sys/windows/winhttp.d
+++ b/libphobos/libdruntime/core/sys/windows/winhttp.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.winhttp;
version (Windows):
-@system:
pragma(lib, "winhttp");
// FIXME: Grouping of constants. Windows SDK doesn't make this entirely clear
// FIXME: Verify WINHTTP_STATUS_CALLBACK function declaration works correctly
diff --git a/libphobos/libdruntime/core/sys/windows/wininet.d b/libphobos/libdruntime/core/sys/windows/wininet.d
index f4aa997..328af50 100644
--- a/libphobos/libdruntime/core/sys/windows/wininet.d
+++ b/libphobos/libdruntime/core/sys/windows/wininet.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.wininet;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "wininet");
diff --git a/libphobos/libdruntime/core/sys/windows/winioctl.d b/libphobos/libdruntime/core/sys/windows/winioctl.d
index b91ddda..f9db05d 100644
--- a/libphobos/libdruntime/core/sys/windows/winioctl.d
+++ b/libphobos/libdruntime/core/sys/windows/winioctl.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.winioctl;
version (Windows):
-@system:
// FIXME: check types of some constants
diff --git a/libphobos/libdruntime/core/sys/windows/winldap.d b/libphobos/libdruntime/core/sys/windows/winldap.d
index 0ab11d6..bcdb2b3 100644
--- a/libphobos/libdruntime/core/sys/windows/winldap.d
+++ b/libphobos/libdruntime/core/sys/windows/winldap.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.winldap;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/winnetwk.d b/libphobos/libdruntime/core/sys/windows/winnetwk.d
index e0c7551..9bf2e64 100644
--- a/libphobos/libdruntime/core/sys/windows/winnetwk.d
+++ b/libphobos/libdruntime/core/sys/windows/winnetwk.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.winnetwk;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "mpr");
diff --git a/libphobos/libdruntime/core/sys/windows/winnls.d b/libphobos/libdruntime/core/sys/windows/winnls.d
index b487a17..f2b5409 100644
--- a/libphobos/libdruntime/core/sys/windows/winnls.d
+++ b/libphobos/libdruntime/core/sys/windows/winnls.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.winnls;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "kernel32");
diff --git a/libphobos/libdruntime/core/sys/windows/winnt.d b/libphobos/libdruntime/core/sys/windows/winnt.d
index bf30072..3bd9966 100644
--- a/libphobos/libdruntime/core/sys/windows/winnt.d
+++ b/libphobos/libdruntime/core/sys/windows/winnt.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.winnt;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
diff --git a/libphobos/libdruntime/core/sys/windows/winperf.d b/libphobos/libdruntime/core/sys/windows/winperf.d
index cd31990..77638c8 100644
--- a/libphobos/libdruntime/core/sys/windows/winperf.d
+++ b/libphobos/libdruntime/core/sys/windows/winperf.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.winperf;
version (Windows):
-@system:
import core.sys.windows.windef;
import core.sys.windows.winbase; // for SYSTEMTIME
diff --git a/libphobos/libdruntime/core/sys/windows/winreg.d b/libphobos/libdruntime/core/sys/windows/winreg.d
index c3e5854..6bffe88 100644
--- a/libphobos/libdruntime/core/sys/windows/winreg.d
+++ b/libphobos/libdruntime/core/sys/windows/winreg.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.winreg;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "advapi32");
diff --git a/libphobos/libdruntime/core/sys/windows/winsock2.d b/libphobos/libdruntime/core/sys/windows/winsock2.d
index 8a4b1fd..b036df3 100644
--- a/libphobos/libdruntime/core/sys/windows/winsock2.d
+++ b/libphobos/libdruntime/core/sys/windows/winsock2.d
@@ -6,7 +6,6 @@
module core.sys.windows.winsock2;
version (Windows):
-@system:
pragma(lib, "ws2_32");
@@ -64,11 +63,11 @@ int getsockopt(SOCKET s, int level, int optname, void* optval, socklen_t* optlen
int setsockopt(SOCKET s, int level, int optname, const(void)* optval, socklen_t optlen);
uint inet_addr(const char* cp);
int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* errorfds, const(timeval)* timeout);
-@trusted char* inet_ntoa(in_addr ina);
+char* inet_ntoa(in_addr ina);
hostent* gethostbyname(const char* name);
hostent* gethostbyaddr(const(void)* addr, int len, int type);
protoent* getprotobyname(const char* name);
-@trusted protoent* getprotobynumber(int number);
+protoent* getprotobynumber(int number);
servent* getservbyname(const char* name, const char* proto);
servent* getservbyport(int port, const char* proto);
}
diff --git a/libphobos/libdruntime/core/sys/windows/winspool.d b/libphobos/libdruntime/core/sys/windows/winspool.d
index 2ff621a..12942fb 100644
--- a/libphobos/libdruntime/core/sys/windows/winspool.d
+++ b/libphobos/libdruntime/core/sys/windows/winspool.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.winspool;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "winspool");
diff --git a/libphobos/libdruntime/core/sys/windows/winsvc.d b/libphobos/libdruntime/core/sys/windows/winsvc.d
index 14ab6e4..f7f2fa7 100644
--- a/libphobos/libdruntime/core/sys/windows/winsvc.d
+++ b/libphobos/libdruntime/core/sys/windows/winsvc.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.winsvc;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "advapi32");
diff --git a/libphobos/libdruntime/core/sys/windows/winuser.d b/libphobos/libdruntime/core/sys/windows/winuser.d
index 078e061..71cd882 100644
--- a/libphobos/libdruntime/core/sys/windows/winuser.d
+++ b/libphobos/libdruntime/core/sys/windows/winuser.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.winuser;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "user32");
diff --git a/libphobos/libdruntime/core/sys/windows/winver.d b/libphobos/libdruntime/core/sys/windows/winver.d
index 5099c3f..dc3d881 100644
--- a/libphobos/libdruntime/core/sys/windows/winver.d
+++ b/libphobos/libdruntime/core/sys/windows/winver.d
@@ -9,7 +9,6 @@
*/
module core.sys.windows.winver;
version (Windows):
-@system:
import core.sys.windows.w32api;
import core.sys.windows.winbase;
import core.sys.windows.sdkddkver;
diff --git a/libphobos/libdruntime/core/sys/windows/wtsapi32.d b/libphobos/libdruntime/core/sys/windows/wtsapi32.d
index 13576bd..4db697a 100644
--- a/libphobos/libdruntime/core/sys/windows/wtsapi32.d
+++ b/libphobos/libdruntime/core/sys/windows/wtsapi32.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.wtsapi32;
version (Windows):
-@system:
version (ANSI) {} else version = Unicode;
pragma(lib, "wtsapi32");
diff --git a/libphobos/libdruntime/core/sys/windows/wtypes.d b/libphobos/libdruntime/core/sys/windows/wtypes.d
index c27dd3a..0206839 100644
--- a/libphobos/libdruntime/core/sys/windows/wtypes.d
+++ b/libphobos/libdruntime/core/sys/windows/wtypes.d
@@ -8,7 +8,6 @@
*/
module core.sys.windows.wtypes;
version (Windows):
-@system:
import core.sys.windows.rpc, core.sys.windows.rpcndr;
import core.sys.windows.windef;
diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index efbad7d..4590ff1 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -19,6 +19,8 @@ import core.thread.threadgroup;
import core.thread.types;
import core.thread.context;
+import core.memory : pageSize;
+
///////////////////////////////////////////////////////////////////////////////
// Fiber Platform Detection
///////////////////////////////////////////////////////////////////////////////
@@ -600,7 +602,7 @@ class Fiber
version (X86_64)
// libunwind on macOS 11 now requires more stack space than 16k, so
// default to a larger stack size. This is only applied to X86 as
- // the PAGESIZE is still 4k, however on AArch64 it is 16k.
+ // the pageSize is still 4k, however on AArch64 it is 16k.
enum defaultStackPages = 8;
else
enum defaultStackPages = 4;
@@ -623,8 +625,8 @@ class Fiber
* In:
* fn must not be null.
*/
- this( void function() fn, size_t sz = PAGESIZE * defaultStackPages,
- size_t guardPageSize = PAGESIZE ) nothrow
+ this( void function() fn, size_t sz = pageSize * defaultStackPages,
+ size_t guardPageSize = pageSize ) nothrow
in
{
assert( fn );
@@ -651,8 +653,8 @@ class Fiber
* In:
* dg must not be null.
*/
- this( void delegate() dg, size_t sz = PAGESIZE * defaultStackPages,
- size_t guardPageSize = PAGESIZE ) nothrow
+ this( void delegate() dg, size_t sz = pageSize * defaultStackPages,
+ size_t guardPageSize = pageSize ) nothrow
{
allocStack( sz, guardPageSize );
reset( cast(void delegate() const) dg );
@@ -962,9 +964,9 @@ private:
}
do
{
- // adjust alloc size to a multiple of PAGESIZE
- sz += PAGESIZE - 1;
- sz -= sz % PAGESIZE;
+ // adjust alloc size to a multiple of pageSize
+ sz += pageSize - 1;
+ sz -= sz % pageSize;
// NOTE: This instance of Thread.Context is dynamic so Fiber objects
// can be collected by the GC so long as no user level references
diff --git a/libphobos/libdruntime/core/thread/osthread.d b/libphobos/libdruntime/core/thread/osthread.d
index 415430c..066f39e 100644
--- a/libphobos/libdruntime/core/thread/osthread.d
+++ b/libphobos/libdruntime/core/thread/osthread.d
@@ -19,7 +19,7 @@ import core.thread.threadbase;
import core.thread.context;
import core.thread.types;
import core.atomic;
-import core.memory : GC;
+import core.memory : GC, pageSize;
import core.time;
import core.exception : onOutOfMemoryError;
import core.internal.traits : externDFunc;
@@ -1115,7 +1115,7 @@ unittest
unittest
{
- // use >PAGESIZE to avoid stack overflow (e.g. in an syscall)
+ // use >pageSize to avoid stack overflow (e.g. in an syscall)
auto thr = new Thread(function{}, 4096 + 1).start();
thr.join();
}
@@ -1997,12 +1997,17 @@ extern (C) void thread_suspendAll() nothrow
Thread.criticalRegionLock.lock_nothrow();
scope (exit) Thread.criticalRegionLock.unlock_nothrow();
size_t cnt;
+ bool suspendedSelf;
Thread t = ThreadBase.sm_tbeg.toThread;
while (t)
{
auto tn = t.next.toThread;
if (suspend(t))
+ {
+ if (t is ThreadBase.getThis())
+ suspendedSelf = true;
++cnt;
+ }
t = tn;
}
@@ -2010,9 +2015,12 @@ extern (C) void thread_suspendAll() nothrow
{}
else version (Posix)
{
- // subtract own thread
+ // Subtract own thread if we called suspend() on ourselves.
+ // For example, suspendedSelf would be false if the current
+ // thread ran thread_detachThis().
assert(cnt >= 1);
- --cnt;
+ if (suspendedSelf)
+ --cnt;
// wait for semaphore notifications
for (; cnt; --cnt)
{
@@ -2881,8 +2889,8 @@ private size_t adjustStackSize(size_t sz) nothrow @nogc
}
}
- // stack size must be a multiple of PAGESIZE
- sz = ((sz + PAGESIZE - 1) & ~(PAGESIZE - 1));
+ // stack size must be a multiple of pageSize
+ sz = ((sz + pageSize - 1) & ~(pageSize - 1));
return sz;
}
diff --git a/libphobos/libdruntime/core/thread/types.d b/libphobos/libdruntime/core/thread/types.d
index e50399a..eb84ad7 100644
--- a/libphobos/libdruntime/core/thread/types.d
+++ b/libphobos/libdruntime/core/thread/types.d
@@ -47,31 +47,15 @@ else
package
{
- static immutable size_t PAGESIZE;
version (Posix) static immutable size_t PTHREAD_STACK_MIN;
}
shared static this()
{
- version (Windows)
- {
- import core.sys.windows.winbase;
-
- SYSTEM_INFO info;
- GetSystemInfo(&info);
-
- PAGESIZE = info.dwPageSize;
- assert(PAGESIZE < int.max);
- }
- else version (Posix)
+ version (Posix)
{
import core.sys.posix.unistd;
- PAGESIZE = cast(size_t)sysconf(_SC_PAGESIZE);
PTHREAD_STACK_MIN = cast(size_t)sysconf(_SC_THREAD_STACK_MIN);
}
- else
- {
- static assert(0, "unimplemented");
- }
}
diff --git a/libphobos/libdruntime/core/time.d b/libphobos/libdruntime/core/time.d
index 9b8391e..8d50875 100644
--- a/libphobos/libdruntime/core/time.d
+++ b/libphobos/libdruntime/core/time.d
@@ -2822,7 +2822,7 @@ struct TickDuration
}
- @trusted shared static this()
+ static pragma(crt_constructor) void time_initializer()
{
version (Windows)
{
@@ -3362,7 +3362,7 @@ struct TickDuration
$(D gettimeofday) (the decision is made when $(D TickDuration) is
compiled), which unfortunately, is not monotonic, but if
$(D mach_absolute_time) and $(D clock_gettime) aren't available, then
- $(D gettimeofday) is the the best that there is.
+ $(D gettimeofday) is the best that there is.
$(RED Warning):
On some systems, the monotonic clock may stop counting when
diff --git a/libphobos/libdruntime/gcc/attribute.d b/libphobos/libdruntime/gcc/attribute.d
index 2b0ef4c..cd38179 100644
--- a/libphobos/libdruntime/gcc/attribute.d
+++ b/libphobos/libdruntime/gcc/attribute.d
@@ -1,5 +1,5 @@
// GNU D Compiler attribute support declarations.
-// Copyright (C) 2013-2022 Free Software Foundation, Inc.
+// Copyright (C) 2013-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/attributes.d b/libphobos/libdruntime/gcc/attributes.d
index 9d7f2e1..0839873 100644
--- a/libphobos/libdruntime/gcc/attributes.d
+++ b/libphobos/libdruntime/gcc/attributes.d
@@ -1,5 +1,5 @@
// GNU D Compiler attribute support declarations.
-// Copyright (C) 2021-2022 Free Software Foundation, Inc.
+// Copyright (C) 2021-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/backtrace.d b/libphobos/libdruntime/gcc/backtrace.d
index f7a6b20..2b4a339 100644
--- a/libphobos/libdruntime/gcc/backtrace.d
+++ b/libphobos/libdruntime/gcc/backtrace.d
@@ -1,5 +1,5 @@
// GNU D Compiler routines for stack backtrace support.
-// Copyright (C) 2013-2022 Free Software Foundation, Inc.
+// Copyright (C) 2013-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -46,7 +46,7 @@ static if (BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC)
/*
* Used for backtrace_create_state and backtrace_simple
*/
- extern(C) void simpleErrorCallback(void* data, const(char)* msg, int errnum)
+ extern(C) void simpleErrorCallback(void* data, const(char)* msg, int errnum) @nogc
{
if (data) // context is not available in backtrace_create_state
{
@@ -187,7 +187,7 @@ static if (BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC)
// FIXME: state is never freed as libbacktrace doesn't provide a free function...
public class LibBacktrace : Throwable.TraceInfo
{
- static void initLibBacktrace()
+ static void initLibBacktrace() @nogc
{
if (!initialized)
{
@@ -196,7 +196,7 @@ static if (BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC)
}
}
- this(int firstFrame)
+ this(int firstFrame) @nogc
{
_firstFrame = firstFrame;
@@ -345,7 +345,7 @@ else
*/
public class UnwindBacktrace : Throwable.TraceInfo
{
- this(int firstFrame)
+ this(int firstFrame) @nogc
{
_firstFrame = firstFrame;
_callstack = getBacktrace();
@@ -436,14 +436,14 @@ private:
return _URC_NO_REASON;
}
- UnwindBacktraceData getBacktrace()
+ UnwindBacktraceData getBacktrace() @nogc
{
UnwindBacktraceData stackframe;
_Unwind_Backtrace(&unwindCB, &stackframe);
return stackframe;
}
- BTSymbolData getBacktraceSymbols(UnwindBacktraceData data)
+ BTSymbolData getBacktraceSymbols(UnwindBacktraceData data) @nogc
{
BTSymbolData symData;
diff --git a/libphobos/libdruntime/gcc/builtins.d b/libphobos/libdruntime/gcc/builtins.d
index c154967..fe4318c 100644
--- a/libphobos/libdruntime/gcc/builtins.d
+++ b/libphobos/libdruntime/gcc/builtins.d
@@ -1,5 +1,5 @@
/* GNU D Compiler bindings for built-in functions and types.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/config.d.in b/libphobos/libdruntime/gcc/config.d.in
index eaf47be..76d9eb7 100644
--- a/libphobos/libdruntime/gcc/config.d.in
+++ b/libphobos/libdruntime/gcc/config.d.in
@@ -1,5 +1,5 @@
// GNU D Compiler configure constants.
-// Copyright (C) 2015-2022 Free Software Foundation, Inc.
+// Copyright (C) 2015-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/deh.d b/libphobos/libdruntime/gcc/deh.d
index dbc83ad..da883a5 100644
--- a/libphobos/libdruntime/gcc/deh.d
+++ b/libphobos/libdruntime/gcc/deh.d
@@ -1,5 +1,5 @@
// GNU D Compiler exception personality routines.
-// Copyright (C) 2011-2022 Free Software Foundation, Inc.
+// Copyright (C) 2011-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/drtstuff.c b/libphobos/libdruntime/gcc/drtstuff.c
index cc05e7c..8556a87 100644
--- a/libphobos/libdruntime/gcc/drtstuff.c
+++ b/libphobos/libdruntime/gcc/drtstuff.c
@@ -1,6 +1,6 @@
/* Provide minfo section bracketing for D executables and shared libraries
when the linker doesn't provide it.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libphobos/libdruntime/gcc/emutls.d b/libphobos/libdruntime/gcc/emutls.d
index ee36032..af03965 100644
--- a/libphobos/libdruntime/gcc/emutls.d
+++ b/libphobos/libdruntime/gcc/emutls.d
@@ -1,5 +1,5 @@
// GNU D Compiler emulated TLS routines.
-// Copyright (C) 2019-2022 Free Software Foundation, Inc.
+// Copyright (C) 2019-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/gthread.d b/libphobos/libdruntime/gcc/gthread.d
index b25742c..de75068 100644
--- a/libphobos/libdruntime/gcc/gthread.d
+++ b/libphobos/libdruntime/gcc/gthread.d
@@ -1,5 +1,5 @@
// GNU D Compiler thread support for emulated TLS routines.
-// Copyright (C) 2019-2022 Free Software Foundation, Inc.
+// Copyright (C) 2019-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/libbacktrace.d.in b/libphobos/libdruntime/gcc/libbacktrace.d.in
index ea6f181..def017d 100644
--- a/libphobos/libdruntime/gcc/libbacktrace.d.in
+++ b/libphobos/libdruntime/gcc/libbacktrace.d.in
@@ -1,5 +1,5 @@
// GNU D Compiler bindings for the stack backtrace functions.
-// Copyright (C) 2013-2022 Free Software Foundation, Inc.
+// Copyright (C) 2013-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -46,28 +46,28 @@ extern(C):
backtrace_error_callback;
backtrace_state* backtrace_create_state(const(char)* filename, int threaded,
- backtrace_error_callback error_callback, void* data) nothrow;
+ backtrace_error_callback error_callback, void* data) @nogc nothrow;
alias extern(C) int function(void* data, uintptr_t pc, const(char)* filename, int lineno, const(char)* func)
backtrace_full_callback;
int backtrace_full(backtrace_state* state, int skip, backtrace_full_callback callback,
- backtrace_error_callback error_callback, void* data) nothrow;
+ backtrace_error_callback error_callback, void* data) @nogc nothrow;
alias extern(C) int function(void* data, uintptr_t pc)
backtrace_simple_callback;
int backtrace_simple(backtrace_state* state, int skip, backtrace_simple_callback callback,
- backtrace_error_callback error_callback, void* data) nothrow;
+ backtrace_error_callback error_callback, void* data) @nogc nothrow;
- void backtrace_print(backtrace_state* state, int skip, FILE* file) nothrow;
+ void backtrace_print(backtrace_state* state, int skip, FILE* file) @nogc nothrow;
int backtrace_pcinfo(backtrace_state* state, uintptr_t pc, backtrace_full_callback callback,
- backtrace_error_callback error_callback, void* data) nothrow;
+ backtrace_error_callback error_callback, void* data) @nogc nothrow;
alias extern(C) void function(void* data, uintptr_t pc, const(char)* symname, uintptr_t symval)
backtrace_syminfo_callback;
int backtrace_syminfo(backtrace_state *state, uintptr_t pc, backtrace_syminfo_callback callback,
- backtrace_error_callback error_callback, void* data) nothrow;
+ backtrace_error_callback error_callback, void* data) @nogc nothrow;
}
diff --git a/libphobos/libdruntime/gcc/sections/common.d b/libphobos/libdruntime/gcc/sections/common.d
index 5fda4ca..e862c62 100644
--- a/libphobos/libdruntime/gcc/sections/common.d
+++ b/libphobos/libdruntime/gcc/sections/common.d
@@ -1,5 +1,5 @@
// Contains various utility functions used by the runtime implementation.
-// Copyright (C) 2019-2022 Free Software Foundation, Inc.
+// Copyright (C) 2019-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/sections/elf.d b/libphobos/libdruntime/gcc/sections/elf.d
index 5819811..0c7a771 100644
--- a/libphobos/libdruntime/gcc/sections/elf.d
+++ b/libphobos/libdruntime/gcc/sections/elf.d
@@ -1,5 +1,5 @@
// ELF-specific support for sections with shared libraries.
-// Copyright (C) 2019-2022 Free Software Foundation, Inc.
+// Copyright (C) 2019-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/sections/macho.d b/libphobos/libdruntime/gcc/sections/macho.d
index 8408366..d9ad5c6 100644
--- a/libphobos/libdruntime/gcc/sections/macho.d
+++ b/libphobos/libdruntime/gcc/sections/macho.d
@@ -1,5 +1,5 @@
// MACHO-specific support for sections.
-// Copyright (C) 2021-2022 Free Software Foundation, Inc.
+// Copyright (C) 2021-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/sections/package.d b/libphobos/libdruntime/gcc/sections/package.d
index 820fd3b..986d3b0 100644
--- a/libphobos/libdruntime/gcc/sections/package.d
+++ b/libphobos/libdruntime/gcc/sections/package.d
@@ -1,5 +1,5 @@
// Run-time support for retrieving platform-specific sections.
-// Copyright (C) 2019-2022 Free Software Foundation, Inc.
+// Copyright (C) 2019-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/sections/pecoff.d b/libphobos/libdruntime/gcc/sections/pecoff.d
index fd27798..97dc486 100644
--- a/libphobos/libdruntime/gcc/sections/pecoff.d
+++ b/libphobos/libdruntime/gcc/sections/pecoff.d
@@ -1,5 +1,5 @@
// PE/COFF-specific support for sections.
-// Copyright (C) 2021-2022 Free Software Foundation, Inc.
+// Copyright (C) 2021-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/simd.d b/libphobos/libdruntime/gcc/simd.d
index ffca50f..2b9202e 100644
--- a/libphobos/libdruntime/gcc/simd.d
+++ b/libphobos/libdruntime/gcc/simd.d
@@ -1,5 +1,5 @@
// GNU D Compiler SIMD support functions and intrinsics.
-// Copyright (C) 2022 Free Software Foundation, Inc.
+// Copyright (C) 2022-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -306,13 +306,25 @@ template blendvector(V0, V1, M)
* assert(c.array == [0, 0, -1, -1]);
* ---
*/
-V equalMask(V)(V op1, V op2) if (isVectorType!V);
+V equalMask(V)(V op1, V op2) if (isVectorType!V)
+{
+ return op1 == op2;
+}
/// Ditto
-V notEqualMask(V)(V op1, V op2) if (isVectorType!V);
+V notEqualMask(V)(V op1, V op2) if (isVectorType!V)
+{
+ return op1 != op2;
+}
/// Ditto
-V greaterMask(V)(V op1, V op2) if (isVectorType!V);
+V greaterMask(V)(V op1, V op2) if (isVectorType!V)
+{
+ return op1 > op2;
+}
/// Ditto
-V greaterOrEqualMask(V)(V op1, V op2) if (isVectorType!V);
+V greaterOrEqualMask(V)(V op1, V op2) if (isVectorType!V)
+{
+ return op1 >= op2;
+}
/**
* Perform an element-wise logical comparison between two vectors, producing
@@ -326,19 +338,19 @@ V greaterOrEqualMask(V)(V op1, V op2) if (isVectorType!V);
*/
V notMask(V)(V op1) if (isVectorType!V)
{
- return equalMask(op1, 0);
+ return op1 == 0;
}
/// Ditto
V andAndMask(V)(V op1, V op2) if (isVectorType!V)
{
- return notEqualMask(op1, 0) & notEqualMask(op2, 0);
+ return (op1 != 0) & (op2 != 0);
}
/// Ditto
V orOrMask(V)(V op1, V op2) if (isVectorType!V)
{
- return notEqualMask(op1, 0) | notEqualMask(op2, 0);
+ return (op1 != 0) | (op2 != 0);
}
// Private helper templates.
diff --git a/libphobos/libdruntime/gcc/unwind/arm.d b/libphobos/libdruntime/gcc/unwind/arm.d
index 18d4d19..20e2800 100644
--- a/libphobos/libdruntime/gcc/unwind/arm.d
+++ b/libphobos/libdruntime/gcc/unwind/arm.d
@@ -1,5 +1,5 @@
// Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2011-2022 Free Software Foundation, Inc.
+// Copyright (C) 2011-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/unwind/arm_common.d b/libphobos/libdruntime/gcc/unwind/arm_common.d
index b007fc1..cf08014 100644
--- a/libphobos/libdruntime/gcc/unwind/arm_common.d
+++ b/libphobos/libdruntime/gcc/unwind/arm_common.d
@@ -1,5 +1,5 @@
// Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2011-2022 Free Software Foundation, Inc.
+// Copyright (C) 2011-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/unwind/c6x.d b/libphobos/libdruntime/gcc/unwind/c6x.d
index 1556a36..72fd213 100644
--- a/libphobos/libdruntime/gcc/unwind/c6x.d
+++ b/libphobos/libdruntime/gcc/unwind/c6x.d
@@ -1,5 +1,5 @@
// Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2011-2022 Free Software Foundation, Inc.
+// Copyright (C) 2011-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/unwind/generic.d b/libphobos/libdruntime/gcc/unwind/generic.d
index 929b75d..e4bbb4b 100644
--- a/libphobos/libdruntime/gcc/unwind/generic.d
+++ b/libphobos/libdruntime/gcc/unwind/generic.d
@@ -1,5 +1,5 @@
// Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2011-2022 Free Software Foundation, Inc.
+// Copyright (C) 2011-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/unwind/package.d b/libphobos/libdruntime/gcc/unwind/package.d
index 56e7f88..8626725 100644
--- a/libphobos/libdruntime/gcc/unwind/package.d
+++ b/libphobos/libdruntime/gcc/unwind/package.d
@@ -1,5 +1,5 @@
// Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2011-2022 Free Software Foundation, Inc.
+// Copyright (C) 2011-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/gcc/unwind/pe.d b/libphobos/libdruntime/gcc/unwind/pe.d
index e0305ab..e0111e7 100644
--- a/libphobos/libdruntime/gcc/unwind/pe.d
+++ b/libphobos/libdruntime/gcc/unwind/pe.d
@@ -1,5 +1,5 @@
// Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2011-2022 Free Software Foundation, Inc.
+// Copyright (C) 2011-2023 Free Software Foundation, Inc.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
diff --git a/libphobos/libdruntime/object.d b/libphobos/libdruntime/object.d
index d842499..a77788b 100644
--- a/libphobos/libdruntime/object.d
+++ b/libphobos/libdruntime/object.d
@@ -1417,7 +1417,7 @@ class TypeInfo_Function : TypeInfo
int func(int a, int b);
}
- alias functionTypes = typeof(__traits(getVirtualFunctions, C, "func"));
+ alias functionTypes = typeof(__traits(getVirtualMethods, C, "func"));
assert(typeid(functionTypes[0]).toString() == "void function()");
assert(typeid(functionTypes[1]).toString() == "void function(int)");
assert(typeid(functionTypes[2]).toString() == "int function(int, int)");
@@ -1431,7 +1431,7 @@ class TypeInfo_Function : TypeInfo
void func(int a);
}
- alias functionTypes = typeof(__traits(getVirtualFunctions, C, "func"));
+ alias functionTypes = typeof(__traits(getVirtualMethods, C, "func"));
Object obj = typeid(functionTypes[0]);
assert(obj.opEquals(typeid(functionTypes[0])));
@@ -2481,6 +2481,8 @@ class Throwable : Object
string toString() const;
}
+ alias TraceDeallocator = void function(TraceInfo) nothrow;
+
string msg; /// A message describing the error.
/**
@@ -2502,6 +2504,12 @@ class Throwable : Object
TraceInfo info;
/**
+ * If set, this is used to deallocate the TraceInfo on destruction.
+ */
+ TraceDeallocator infoDeallocator;
+
+
+ /**
* A reference to the _next error in the list. This is used when a new
* $(D Throwable) is thrown from inside a $(D catch) block. The originally
* caught $(D Exception) will be chained to the new $(D Throwable) via this
@@ -2614,6 +2622,13 @@ class Throwable : Object
{
if (nextInChain && nextInChain._refcount)
_d_delThrowable(nextInChain);
+ // handle owned traceinfo
+ if (infoDeallocator !is null)
+ {
+ infoDeallocator(info);
+ info = null; // avoid any kind of dangling pointers if we can help
+ // it.
+ }
}
/**
@@ -2700,7 +2715,7 @@ class Exception : Throwable
* Creates a new instance of Exception. The nextInChain parameter is used
* internally and should always be $(D null) when passed by user code.
* This constructor does not automatically throw the newly-created
- * Exception; the $(D throw) statement should be used for that purpose.
+ * Exception; the $(D throw) expression should be used for that purpose.
*/
@nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null)
{
@@ -2912,25 +2927,6 @@ void clear(Value, Key)(Value[Key]* aa)
assert("k1" !in aa);
}
-// Issue 20559
-@system unittest
-{
- static class Foo
- {
- int[string] aa;
- alias aa this;
- }
-
- auto v = new Foo();
- v["Hello World"] = 42;
- v.clear;
- assert("Hello World" !in v);
-
- // Test for T*
- static assert(!__traits(compiles, (&v).clear));
- static assert( __traits(compiles, (*(&v)).clear));
-}
-
/***********************************
* Reorganizes the associative array in place so that lookups are more
* efficient.
@@ -4265,44 +4261,6 @@ void destroy(bool initialize = true, T)(T obj) if (is(T == interface))
@system unittest
{
- // class with an `alias this`
- class A
- {
- static int dtorCount;
- ~this()
- {
- dtorCount++;
- }
- }
-
- class B
- {
- A a;
- alias a this;
- this()
- {
- a = new A;
- }
- static int dtorCount;
- ~this()
- {
- dtorCount++;
- }
- }
- auto b = new B;
- assert(A.dtorCount == 0);
- assert(B.dtorCount == 0);
- destroy(b);
- assert(A.dtorCount == 0);
- assert(B.dtorCount == 1);
-
- auto a = new A;
- destroy(a);
- assert(A.dtorCount == 1);
-}
-
-@system unittest
-{
interface I { }
{
class A: I { string s = "A"; this() {} }
@@ -4514,43 +4472,6 @@ if (__traits(isStaticArray, T))
}
}
-// https://issues.dlang.org/show_bug.cgi?id=19218
-@system unittest
-{
- static struct S
- {
- static dtorCount = 0;
- ~this() { ++dtorCount; }
- }
-
- static interface I
- {
- ref S[3] getArray();
- alias getArray this;
- }
-
- static class C : I
- {
- static dtorCount = 0;
- ~this() { ++dtorCount; }
-
- S[3] a;
- alias a this;
-
- ref S[3] getArray() { return a; }
- }
-
- C c = new C();
- destroy(c);
- assert(S.dtorCount == 3);
- assert(C.dtorCount == 1);
-
- I i = new C();
- destroy(i);
- assert(S.dtorCount == 6);
- assert(C.dtorCount == 2);
-}
-
/// ditto
void destroy(bool initialize = true, T)(ref T obj)
if (!is(T == struct) && !is(T == interface) && !is(T == class) && !__traits(isStaticArray, T))
@@ -4607,7 +4528,8 @@ they are only intended to be instantiated by the compiler, not the user.
public import core.internal.entrypoint : _d_cmain;
public import core.internal.array.appending : _d_arrayappendT;
-public import core.internal.array.appending : _d_arrayappendTTrace;
+version (D_ProfileGC)
+ public import core.internal.array.appending : _d_arrayappendTTrace;
public import core.internal.array.appending : _d_arrayappendcTXImpl;
public import core.internal.array.comparison : __cmp;
public import core.internal.array.equality : __equals;
@@ -4617,6 +4539,7 @@ public import core.internal.array.construction : _d_arrayctor;
public import core.internal.array.construction : _d_arraysetctor;
public import core.internal.array.arrayassign : _d_arrayassign_l;
public import core.internal.array.arrayassign : _d_arrayassign_r;
+public import core.internal.array.arrayassign : _d_arraysetassign;
public import core.internal.array.capacity: _d_arraysetlengthTImpl;
public import core.internal.dassert: _d_assert_fail;
@@ -4632,6 +4555,8 @@ public import core.internal.switch_: __switch_error;
public import core.lifetime : _d_delstructImpl;
public import core.lifetime : _d_newThrowable;
+public import core.lifetime : _d_newclassT;
+public import core.lifetime : _d_newclassTTrace;
public @trusted @nogc nothrow pure extern (C) void _d_delThrowable(scope Throwable);
diff --git a/libphobos/libdruntime/rt/arrayassign.d b/libphobos/libdruntime/rt/arrayassign.d
deleted file mode 100644
index c9e2b15..0000000
--- a/libphobos/libdruntime/rt/arrayassign.d
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Implementation of array assignment support routines.
- *
- *
- * Copyright: Copyright Digital Mars 2010 - 2016.
- * License: Distributed under the
- * $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
- * Authors: Walter Bright, Kenji Hara
- * Source: $(DRUNTIMESRC rt/_arrayassign.d)
- */
-
-module rt.arrayassign;
-
-private
-{
- import core.internal.util.array;
- import core.stdc.string;
- import core.stdc.stdlib;
- debug(PRINTF) import core.stdc.stdio;
-}
-
-/**
-Set all elements of an array to a single value.
-
----
-p[0 .. count] = value;
----
-
-Takes into account postblits and destructors, for Plain Old Data elements,
-`rt/memset.d` is used.
-
-Params:
- p = pointer to start of array
- value = bytes of the element to set. Size is derived from `ti`.
- count = amount of array elements to set
- ti = type info of the array element type / `value`
-Returns: `p`
-*/
-extern (C) void* _d_arraysetassign(void* p, void* value, int count, TypeInfo ti)
-{
- void* pstart = p;
-
- auto element_size = ti.tsize;
-
- // Need a temporary buffer tmp[] big enough to hold one element
- immutable maxAllocaSize = 512;
- void *ptmp = (element_size > maxAllocaSize) ? malloc(element_size) : alloca(element_size);
-
- foreach (i; 0 .. count)
- {
- memcpy(ptmp, p, element_size);
- memcpy(p, value, element_size);
- ti.postblit(p);
- ti.destroy(ptmp);
- p += element_size;
- }
- if (element_size > maxAllocaSize)
- free(ptmp);
- return pstart;
-}
diff --git a/libphobos/libdruntime/rt/deh.d b/libphobos/libdruntime/rt/deh.d
index 695f2ce..0a44be3 100644
--- a/libphobos/libdruntime/rt/deh.d
+++ b/libphobos/libdruntime/rt/deh.d
@@ -42,12 +42,14 @@ module rt.deh;
extern (C)
{
Throwable.TraceInfo _d_traceContext(void* ptr = null);
+ Throwable.TraceDeallocator rt_getTraceDeallocator();
void _d_createTrace(Throwable t, void* context)
{
if (t !is null && t.info is null &&
cast(byte*) t !is typeid(t).initializer.ptr)
{
t.info = _d_traceContext(context);
+ t.infoDeallocator = rt_getTraceDeallocator();
}
}
}
diff --git a/libphobos/libdruntime/rt/dmain2.d b/libphobos/libdruntime/rt/dmain2.d
index 0739b74..8a10aac 100644
--- a/libphobos/libdruntime/rt/dmain2.d
+++ b/libphobos/libdruntime/rt/dmain2.d
@@ -182,6 +182,7 @@ extern (C) int rt_term()
*/
alias Throwable.TraceInfo function(void* ptr) TraceHandler;
private __gshared TraceHandler traceHandler = null;
+private __gshared Throwable.TraceDeallocator traceDeallocator = null;
/**
@@ -189,10 +190,12 @@ private __gshared TraceHandler traceHandler = null;
*
* Params:
* h = The new trace handler. Set to null to use the default handler.
+ * d = The new dealloactor to use.
*/
-extern (C) void rt_setTraceHandler(TraceHandler h)
+extern (C) void rt_setTraceHandler(TraceHandler h, Throwable.TraceDeallocator d = null)
{
traceHandler = h;
+ traceDeallocator = d;
}
/**
@@ -203,6 +206,11 @@ extern (C) TraceHandler rt_getTraceHandler()
return traceHandler;
}
+extern (C) Throwable.TraceDeallocator rt_getTraceDeallocator()
+{
+ return traceDeallocator;
+}
+
/**
* This function will be called when an exception is constructed. The
* user-supplied trace handler will be called if one has been supplied,
@@ -577,7 +585,7 @@ extern (C) void _d_print_throwable(Throwable t)
{
WCHAR* ptr; size_t len;
- void sink(const scope char[] s) scope nothrow
+ void sink(in char[] s) scope nothrow
{
if (!s.length) return;
int swlen = MultiByteToWideChar(
diff --git a/libphobos/libdruntime/rt/lifetime.d b/libphobos/libdruntime/rt/lifetime.d
index 026001f..f2515c3 100644
--- a/libphobos/libdruntime/rt/lifetime.d
+++ b/libphobos/libdruntime/rt/lifetime.d
@@ -1232,61 +1232,6 @@ debug(PRINTF)
/**
*
*/
-extern (C) void _d_delarray_t(void[]* p, const TypeInfo_Struct ti) @weak
-{
- if (p)
- {
- auto bic = __getBlkInfo(p.ptr);
- auto info = bic ? *bic : GC.query(p.ptr);
-
- if (info.base && (info.attr & BlkAttr.APPENDABLE))
- {
- if (ti) // ti non-null only if ti is a struct with dtor
- {
- void* start = __arrayStart(info);
- size_t length = __arrayAllocLength(info, ti);
- finalize_array(start, length, ti);
- }
-
- // if p is in the cache, clear it there as well
- if (bic)
- bic.base = null;
-
- GC.free(info.base);
- *p = null;
- }
- }
-}
-
-deprecated unittest
-{
- __gshared size_t countDtor = 0;
- struct S
- {
- int x;
- ~this() { countDtor++; }
- }
- // destroy large array with x.ptr not base address of allocation
- auto x = new S[10000];
- void* p = x.ptr;
- assert(GC.addrOf(p) != null);
- _d_delarray_t(cast(void[]*)&x, typeid(typeof(x[0]))); // delete x;
- assert(GC.addrOf(p) == null);
- assert(countDtor == 10000);
-
- // destroy full array even if only slice passed
- auto y = new S[400];
- auto z = y[200 .. 300];
- p = z.ptr;
- assert(GC.addrOf(p) != null);
- _d_delarray_t(cast(void[]*)&z, typeid(typeof(z[0]))); // delete z;
- assert(GC.addrOf(p) == null);
- assert(countDtor == 10000 + 400);
-}
-
-/**
- *
- */
extern (C) void _d_delmemory(void* *p) @weak
{
if (*p)
@@ -2755,11 +2700,6 @@ deprecated unittest
}
dtorCount = 0;
- S1[] arr1 = new S1[7];
- _d_delarray_t(cast(void[]*)&arr1, typeid(typeof(arr1[0]))); // delete arr1;
- assert(dtorCount == 7);
-
- dtorCount = 0;
S1* s2 = new S1;
GC.runFinalizers((cast(char*)(typeid(S1).xdtor))[0..1]);
assert(dtorCount == 1);