Files
gcc/libphobos/libdruntime/core/stdc/string.d
Iain Buclaw 51c4eb28c1 d: Merge dmd. druntime e770945277, phobos 6d6e0b9b9
D front-end changes:

    - Import latest fixes from dmd v2.107.0-beta.1.
    - Hex strings can now be cast to integer arrays.
    - Add support for Interpolated Expression Sequences.

D runtime changes:

    - Import latest fixes from druntime v2.107.0-beta.1.
    - New core.interpolation module to provide run-time support for D
      interpolated expression sequence literals.

Phobos changes:

    - Import latest fixes from phobos v2.107.0-beta.1.
    - `std.range.primitives.isBidirectionalRange', and
      `std.range.primitives.isRandomAccessRange' now take an optional
      element type.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd e770945277.
	* Make-lang.in (D_FRONTEND_OBJS): Add d/basicmangle.o, d/enumsem.o,
	d/funcsem.o, d/templatesem.o.
	* d-builtins.cc (build_frontend_type): Update for new front-end
	interface.
	* d-codegen.cc (declaration_type): Likewise.
	(parameter_type): Likewise.
	* d-incpath.cc (add_globalpaths): Likewise.
	(add_filepaths): Likewise.
	(add_import_paths): Likewise.
	* d-lang.cc (d_init_options): Likewise.
	(d_handle_option): Likewise.
	(d_parse_file): Likewise.
	* decl.cc (DeclVisitor::finish_vtable): Likewise.
	(DeclVisitor::visit (FuncDeclaration *)): Likewise.
	(get_symbol_decl): Likewise.
	* expr.cc (ExprVisitor::visit (StringExp *)): Likewise.
	Implement support for 8-byte hexadecimal strings.
	* typeinfo.cc (create_tinfo_types): Update internal TypeInfo
	representation.
	(TypeInfoVisitor::visit (TypeInfoConstDeclaration *)): Update for new
	front-end interface.
	(TypeInfoVisitor::visit (TypeInfoInvariantDeclaration *)): Likewise.
	(TypeInfoVisitor::visit (TypeInfoSharedDeclaration *)): Likewise.
	(TypeInfoVisitor::visit (TypeInfoWildDeclaration *)): Likewise.
	(TypeInfoVisitor::visit (TypeInfoClassDeclaration *)): Move data for
	TypeInfo_Class.nameSig to the end of the object.
	(create_typeinfo): Update for new front-end interface.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime e770945277.
	* libdruntime/Makefile.am (DRUNTIME_SOURCES): Add
	core/interpolation.d.
	* libdruntime/Makefile.in: Regenerate.
	* src/MERGE: Merge upstream phobos 6d6e0b9b9.
2024-02-03 12:03:37 +01:00

108 lines
2.9 KiB
D

/**
* D header file for C99.
*
* $(C_HEADER_DESCRIPTION pubs.opengroup.org/onlinepubs/009695399/basedefs/_string.h.html, _string.h)
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: Distributed under the
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
* (See accompanying file LICENSE)
* Authors: Sean Kelly
* Source: $(DRUNTIMESRC core/stdc/_string.d)
* Standards: ISO/IEC 9899:1999 (E)
*/
module core.stdc.string;
version (OSX)
version = Darwin;
else version (iOS)
version = Darwin;
else version (TVOS)
version = Darwin;
else version (WatchOS)
version = Darwin;
// Those libs don't expose the mandated C interface
version (CRuntime_Glibc)
version = ReturnStrerrorR;
else version (CRuntime_UClibc)
version = ReturnStrerrorR;
extern (C):
nothrow:
@nogc:
///
inout(void)* memchr(return scope inout void* s, int c, size_t n) pure;
///
int memcmp(scope const void* s1, scope const void* s2, size_t n) pure;
///
void* memcpy(return scope void* s1, scope const void* s2, size_t n) pure;
version (Windows)
{
///
int memicmp(scope const char* s1, scope const char* s2, size_t n);
}
///
void* memmove(return scope void* s1, scope const void* s2, size_t n) pure;
///
void* memset(return scope void* s, int c, size_t n) pure;
///
char* strcat(return scope char* s1, scope const char* s2) pure;
///
inout(char)* strchr(return scope inout(char)* s, int c) pure;
///
int strcmp(scope const char* s1, scope const char* s2) pure;
///
int strcoll(scope const char* s1, scope const char* s2);
///
char* strcpy(return scope char* s1, scope const char* s2) pure;
///
size_t strcspn(scope const char* s1, scope const char* s2) pure;
///
char* strdup(scope const char *s);
///
char* strndup(scope const char *str, size_t size);
///
char* strerror(int errnum);
// This `strerror_r` definition is not following the POSIX standard
version (ReturnStrerrorR)
{
///
const(char)* strerror_r(int errnum, return scope char* buf, size_t buflen);
}
// This one is
else version (CRuntime_Newlib)
{
///
pragma(mangle, "__xpg_strerror_r")
int strerror_r(int errnum, scope char* buf, size_t buflen);
}
else
{
///
int strerror_r(int errnum, scope char* buf, size_t buflen);
}
///
size_t strlen(scope const char* s) pure;
///
char* strncat(return scope char* s1, scope const char* s2, size_t n) pure;
///
int strncmp(scope const char* s1, scope const char* s2, size_t n) pure;
///
char* strncpy(return scope char* s1, scope const char* s2, size_t n) pure;
///
inout(char)* strpbrk(return scope inout(char)* s1, scope const char* s2) pure;
///
inout(char)* strrchr(return scope inout(char)* s, int c) pure;
///
size_t strspn(scope const char* s1, scope const char* s2) pure;
///
inout(char)* strstr(return scope inout(char)* s1, scope const char* s2) pure;
///
char* strtok(return scope char* s1, scope const char* s2);
///
size_t strxfrm(scope char* s1, scope const char* s2, size_t n);