| 1 |
|
| 2 |
/* Copyright (C) 1999-2025 by The D Language Foundation, All Rights Reserved |
| 3 |
* written by Walter Bright |
| 4 |
* https://www.digitalmars.com |
| 5 |
* Distributed under the Boost Software License, Version 1.0. |
| 6 |
* https://www.boost.org/LICENSE_1_0.txt |
| 7 |
* https://github.com/dlang/dmd/blob/master/src/dmd/root/port.h |
| 8 |
*/ |
| 9 |
|
| 10 |
#pragma once |
| 11 |
|
| 12 |
// Portable wrapper around compiler/system specific things. |
| 13 |
// The idea is to minimize #ifdef's in the app code. |
| 14 |
|
| 15 |
#include "dsystem.h" |
| 16 |
#include "dcompat.h" |
| 17 |
|
| 18 |
typedef unsigned char utf8_t; |
| 19 |
|
| 20 |
struct Port |
| 21 |
{ |
| 22 |
static int memicmp(const char *s1, const char *s2, d_size_t n); |
| 23 |
static char *strupr(char *s); |
| 24 |
|
| 25 |
static bool isFloat32LiteralOutOfRange(const char *s); |
| 26 |
static bool isFloat64LiteralOutOfRange(const char *s); |
| 27 |
|
| 28 |
static void writelongLE(unsigned value, void *buffer); |
| 29 |
static unsigned readlongLE(const void *buffer); |
| 30 |
static void writelongBE(unsigned value, void *buffer); |
| 31 |
static unsigned readlongBE(const void *buffer); |
| 32 |
static unsigned readwordLE(const void *buffer); |
| 33 |
static unsigned readwordBE(const void *buffer); |
| 34 |
static void valcpy(void *dst, uint64_t val, d_size_t size); |
| 35 |
}; |