aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/dmd/root/port.d
blob: 5fd8080f87ed1ea637583378735243de5be28878 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
 * Portable routines for functions that have different implementations on different platforms.
 *
 * Copyright: Copyright (C) 1999-2025 by The D Language Foundation, All Rights Reserved
 * Authors:   Walter Bright, https://www.digitalmars.com
 * License:   $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
 * Source:    $(LINK2 https://github.com/dlang/dmd/blob/master/compiler/src/dmd/root/port.d, root/_port.d)
 * Documentation:  https://dlang.org/phobos/dmd_root_port.html
 * Coverage:    https://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/root/port.d
 */

module dmd.root.port;

import core.stdc.stdint;

nothrow @nogc:

extern (C++) struct Port
{
    nothrow @nogc:

    static int memicmp(scope const char* s1, scope const char* s2, size_t n) pure;

    static char* strupr(char* s) pure;

    static bool isFloat32LiteralOutOfRange(scope const(char)* s);

    static bool isFloat64LiteralOutOfRange(scope const(char)* s);

    // Little endian
    static void writelongLE(uint value, scope void* buffer) pure;

    // Little endian
    static uint readlongLE(scope const void* buffer) pure;

    // Big endian
    static void writelongBE(uint value, scope void* buffer) pure;

    // Big endian
    static uint readlongBE(scope const void* buffer) pure;

    // Little endian
    static uint readwordLE(scope const void* buffer) pure;

    // Big endian
    static uint readwordBE(scope const void* buffer) pure;

    static void valcpy(scope void *dst, uint64_t val, size_t size) pure;
}