gcc/libphobos/libdruntime/core/sys/netbsd/dlfcn.d
Iain Buclaw d75691877c d: Merge upstream dmd 52844d4b1, druntime dbd0c874, phobos 896b1d0e1.
D front-end changes:

    - Parsing and compiling C code is now possible using `import'.
    - `throw' statements can now be used as an expression.
    - Improvements to the D template emission strategy when compiling
      with `-funittest'.

D Runtime changes:

    - New core.int128 module for implementing intrinsics to support
      128-bit integer types.
    - C bindings for the kernel and C runtime have been better separated
      to allow compiling for hybrid targets, such as kFreeBSD.

Phobos changes:

    - The std.experimental.checkedint module has been renamed to
      std.checkedint.

gcc/d/ChangeLog:

	* d-builtins.cc (d_build_builtins_module): Set purity of DECL_PURE_P
	functions to PURE::const_.
	* d-gimplify.cc (bit_field_ref): New function.
	(d_gimplify_modify_expr): Handle implicit casting for assignments to
	bit-fields.
	(d_gimplify_unary_expr): New function.
	(d_gimplify_binary_expr): New function.
	(d_gimplify_expr): Handle UNARY_CLASS_P and BINARY_CLASS_P.
	* d-target.cc (Target::_init): Initialize bitFieldStyle.
	(TargetCPP::parameterType): Update signature.
	(Target::supportsLinkerDirective): New function.
	* dmd/MERGE: Merge upstream dmd 52844d4b1.
	* expr.cc (ExprVisitor::visit (ThrowExp *)): New function.
	* types.cc (d_build_bitfield_integer_type): New function.
	(insert_aggregate_bitfield): New function.
	(layout_aggregate_members): Handle inserting bit-fields into an
	aggregate type.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* libdruntime/MERGE: Merge upstream druntime dbd0c874.
	* libdruntime/Makefile.am (DRUNTIME_CSOURCES): Add core/int128.d.
	(DRUNTIME_DISOURCES): Add __builtins.di.
	* libdruntime/Makefile.in: Regenerate.
	* src/MERGE: Merge upstream phobos 896b1d0e1.
	* src/Makefile.am (PHOBOS_DSOURCES): Add std/checkedint.d.
	* src/Makefile.in: Regenerate.
	* testsuite/testsuite_flags.in: Add -fall-instantiations to
	--gdcflags.
2022-02-16 11:15:02 +01:00

81 lines
2.6 KiB
D

/**
* D header file for NetBSD.
*
* Copyright: Copyright Martin Nowak 2012.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Martin Nowak
*
* http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/include/dlfcn.h
*/
module core.sys.netbsd.dlfcn;
public import core.sys.posix.dlfcn;
version (NetBSD):
extern (C):
nothrow:
@nogc:
enum __BSD_VISIBLE = true;
/*
* Request arguments for dlinfo().
*/
enum RTLD_DI_LINKMAP = 3; /* Obtain link map. */
enum RTLD_DI_SERINFO = 5; /* Obtain search path info. */
enum RTLD_DI_SERINFOSIZE = 6; /* ... query for required space. */
enum RTLD_DI_ORIGIN = 7; /* Obtain object origin */
enum RTLD_DI_MAX = RTLD_DI_ORIGIN;
/*
* Special handle arguments for dlsym()/dlinfo().
*/
enum RTLD_NEXT = cast(void *)-1; /* Search subsequent objects. */
enum RTLD_DEFAULT = cast(void *)-2; /* Use default search algorithm. */
enum RTLD_SELF = cast(void *)-3; /* Search the caller itself. */
static if (__BSD_VISIBLE)
{
/*-
* The actual type declared by this typedef is immaterial, provided that
* it is a function pointer. Its purpose is to provide a return type for
* dlfunc() which can be cast to a function pointer type without depending
* on behavior undefined by the C standard, which might trigger a compiler
* diagnostic. We intentionally declare a unique type signature to force
* a diagnostic should the application not cast the return value of dlfunc()
* appropriately.
*/
struct __dlfunc_arg {
int __dlfunc_dummy;
}
alias dlfunc_t = void function(__dlfunc_arg);
/*
* Structures, returned by the RTLD_DI_SERINFO dlinfo() request.
*/
struct Dl_serpath {
char * dls_name; /* single search path entry */
uint dls_flags; /* path information */
}
struct Dl_serinfo {
size_t dls_size; /* total buffer size */
uint dls_cnt; /* number of path entries */
Dl_serpath[1] dls_serpath; /* there may be more than one */
}
}
/* XSI functions first. */
extern(C) {
static assert(is(typeof(&dlclose) == int function(void*)));
static assert(is(typeof(&dlerror) == char* function()));
static assert(is(typeof(&dlopen) == void* function(const scope char*, int)));
static assert(is(typeof(&dlsym) == void* function(void*, const scope char*)));
}
static if (__BSD_VISIBLE)
{
int dlinfo(void*, int, void*);
void* dlvsym(void*, const(char)*, const(char)*);
}