mirror of
https://github.com/openRuyi-Project/gcc.git
synced 2026-09-07 14:32:07 +00:00
D front-end changes:
- Import dmd v2.101.0-beta.1.
- Add predefined version `D_Optimized' when compiling with `-O'.
- Shortened method syntax (DIP1043) is now enabled by default.
- Array literals assigned to `scope' array variables are now
allocated on the stack.
- Implement `@system' variables (DIP1035), available behind the
preview feature flag `-fpreview=systemvariables'.
D runtime changes:
- Import druntime v2.101.0-beta.1.
Phobos changes:
- Import phobos v2.101.0-beta.1.
- Added `std.typecons.SafeRefCounted', that can be used in `@safe'
code with `-fpreview=dip1000'.
gcc/d/ChangeLog:
* d-attribs.cc (apply_user_attributes): Update for new front-end
interface.
* d-builtins.cc (d_init_versions): Predefine `D_Optimized' with
compiling with optimizations enabled.
* d-lang.cc (d_handle_option): Update for new front-end interface.
Handle new option `-fpreview=systemvariables'.
* dmd/MERGE: Merge upstream dmd e4f8919591.
* dmd/VERSION: Bump version to v2.101.0-beta.1.
* expr.cc (ExprVisitor::visit (AssignExp *)): Treat construction of
static arrays from a call expression as a simple assignment.
(ExprVisitor::visit (ArrayLiteralExp *)): Handle array literals with
`scope' storage.
* gdc.texi: Update documentation of `-fpreview=' options.
* lang.opt (fpreview=shortenedmethods): Remove.
(fpreview=systemvariables): New option.
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime e4f8919591.
* src/MERGE: Merge upstream phobos 3ad507b51.
gcc/testsuite/ChangeLog:
* gdc.dg/simd19630.d: Move tests with errors to ...
* gdc.dg/simd19630b.d: ... here. New test.
* gdc.dg/simd19630c.d: New test.
* gdc.dg/simd_ctfe.d: Removed.
* gdc.dg/simd18867.d: New test.
* gdc.dg/simd19788.d: New test.
* gdc.dg/simd21469.d: New test.
* gdc.dg/simd21672.d: New test.
* gdc.dg/simd23077.d: New test.
* gdc.dg/simd23084.d: New test.
* gdc.dg/simd23085.d: New test.
* gdc.dg/torture/simd19632.d: New test.
* gdc.dg/torture/simd20041.d: New test.
* gdc.dg/torture/simd21673.d: New test.
* gdc.dg/torture/simd21676.d: New test.
* gdc.dg/torture/simd22438.d: New test.
* gdc.dg/torture/simd23009.d: New test.
* gdc.dg/torture/simd23077.d: New test.
* gdc.dg/torture/simd8.d: New test.
* gdc.dg/torture/simd9.d: New test.
* gdc.dg/torture/simd_prefetch.d: New test.
345 lines
6.4 KiB
D
345 lines
6.4 KiB
D
/**
|
|
* D header file for POSIX.
|
|
*
|
|
* Copyright: Copyright Sean Kelly 2005 - 2009.
|
|
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
|
|
* Authors: Sean Kelly
|
|
* Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
|
|
*/
|
|
|
|
/* Copyright Sean Kelly 2005 - 2009.
|
|
* Distributed under the Boost Software License, Version 1.0.
|
|
* (See accompanying file LICENSE or copy at
|
|
* http://www.boost.org/LICENSE_1_0.txt)
|
|
*/
|
|
module core.sys.posix.poll;
|
|
|
|
import core.sys.posix.config;
|
|
|
|
version (OSX)
|
|
version = Darwin;
|
|
else version (iOS)
|
|
version = Darwin;
|
|
else version (TVOS)
|
|
version = Darwin;
|
|
else version (WatchOS)
|
|
version = Darwin;
|
|
|
|
version (Posix):
|
|
extern (C):
|
|
nothrow:
|
|
@nogc:
|
|
|
|
//
|
|
// XOpen (XSI)
|
|
//
|
|
/*
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
nfds_t
|
|
|
|
int poll(pollfd[], nfds_t, int);
|
|
*/
|
|
|
|
version (CRuntime_Glibc)
|
|
{
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
alias c_ulong nfds_t;
|
|
|
|
int poll(pollfd*, nfds_t, int);
|
|
}
|
|
else version (Darwin)
|
|
{
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
alias uint nfds_t;
|
|
|
|
int poll(pollfd*, nfds_t, int);
|
|
}
|
|
else version (FreeBSD)
|
|
{
|
|
alias uint nfds_t;
|
|
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
int poll(pollfd*, nfds_t, int);
|
|
}
|
|
else version (NetBSD)
|
|
{
|
|
alias uint nfds_t;
|
|
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
int poll(pollfd*, nfds_t, int);
|
|
}
|
|
else version (OpenBSD)
|
|
{
|
|
alias uint nfds_t;
|
|
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
int poll(pollfd*, nfds_t, int);
|
|
}
|
|
else version (DragonFlyBSD)
|
|
{
|
|
alias uint nfds_t;
|
|
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
int poll(pollfd*, nfds_t, int);
|
|
}
|
|
else version (Solaris)
|
|
{
|
|
alias c_ulong nfds_t;
|
|
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
int poll(pollfd*, nfds_t, int);
|
|
}
|
|
else version (CRuntime_Bionic)
|
|
{
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
alias uint nfds_t;
|
|
|
|
int poll(pollfd*, nfds_t, c_long);
|
|
}
|
|
else version (CRuntime_Musl)
|
|
{
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
alias uint nfds_t;
|
|
|
|
int poll(pollfd*, nfds_t, c_long);
|
|
}
|
|
else version (CRuntime_UClibc)
|
|
{
|
|
struct pollfd
|
|
{
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
}
|
|
|
|
alias c_ulong nfds_t;
|
|
|
|
int poll(pollfd*, nfds_t, int);
|
|
}
|
|
else
|
|
{
|
|
static assert(false, "Unsupported platform");
|
|
}
|
|
|
|
/*
|
|
POLLIN
|
|
POLLRDNORM
|
|
POLLRDBAND
|
|
POLLPRI
|
|
POLLOUT
|
|
POLLWRNORM
|
|
POLLWRBAND
|
|
POLLERR
|
|
POLLHUP
|
|
POLLNVAL
|
|
*/
|
|
|
|
version (linux)
|
|
{
|
|
enum
|
|
{
|
|
POLLIN = 0x001,
|
|
POLLRDNORM = 0x040,
|
|
POLLRDBAND = 0x080,
|
|
POLLPRI = 0x002,
|
|
POLLOUT = 0x004,
|
|
POLLWRNORM = 0x100,
|
|
POLLWRBAND = 0x200,
|
|
POLLERR = 0x008,
|
|
POLLHUP = 0x010,
|
|
POLLNVAL = 0x020,
|
|
}
|
|
}
|
|
else version (Darwin)
|
|
{
|
|
enum
|
|
{
|
|
POLLIN = 0x0001,
|
|
POLLPRI = 0x0002,
|
|
POLLOUT = 0x0004,
|
|
POLLRDNORM = 0x0040,
|
|
POLLWRNORM = POLLOUT,
|
|
POLLRDBAND = 0x0080,
|
|
POLLWRBAND = 0x0100,
|
|
POLLEXTEND = 0x0200,
|
|
POLLATTRIB = 0x0400,
|
|
POLLNLINK = 0x0800,
|
|
POLLWRITE = 0x1000,
|
|
POLLERR = 0x0008,
|
|
POLLHUP = 0x0010,
|
|
POLLNVAL = 0x0020,
|
|
|
|
POLLSTANDARD = (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|
|
|
POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
|
|
}
|
|
}
|
|
else version (FreeBSD)
|
|
{
|
|
enum
|
|
{
|
|
POLLIN = 0x0001,
|
|
POLLPRI = 0x0002,
|
|
POLLOUT = 0x0004,
|
|
POLLRDNORM = 0x0040,
|
|
POLLWRNORM = POLLOUT,
|
|
POLLRDBAND = 0x0080,
|
|
POLLWRBAND = 0x0100,
|
|
//POLLEXTEND = 0x0200,
|
|
//POLLATTRIB = 0x0400,
|
|
//POLLNLINK = 0x0800,
|
|
//POLLWRITE = 0x1000,
|
|
POLLERR = 0x0008,
|
|
POLLHUP = 0x0010,
|
|
POLLNVAL = 0x0020,
|
|
|
|
POLLSTANDARD = (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|
|
|
POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
|
|
}
|
|
}
|
|
else version (NetBSD)
|
|
{
|
|
enum
|
|
{
|
|
POLLIN = 0x0001,
|
|
POLLPRI = 0x0002,
|
|
POLLOUT = 0x0004,
|
|
POLLRDNORM = 0x0040,
|
|
POLLWRNORM = POLLOUT,
|
|
POLLRDBAND = 0x0080,
|
|
POLLWRBAND = 0x0100,
|
|
//POLLEXTEND = 0x0200,
|
|
//POLLATTRIB = 0x0400,
|
|
//POLLNLINK = 0x0800,
|
|
//POLLWRITE = 0x1000,
|
|
POLLERR = 0x0008,
|
|
POLLHUP = 0x0010,
|
|
POLLNVAL = 0x0020,
|
|
|
|
POLLSTANDARD = (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|
|
|
POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
|
|
}
|
|
}
|
|
else version (OpenBSD)
|
|
{
|
|
enum
|
|
{
|
|
POLLIN = 0x0001,
|
|
POLLPRI = 0x0002,
|
|
POLLOUT = 0x0004,
|
|
POLLRDNORM = 0x0040,
|
|
POLLNORM = POLLRDNORM,
|
|
POLLWRNORM = POLLOUT,
|
|
POLLRDBAND = 0x0080,
|
|
POLLWRBAND = 0x0100,
|
|
POLLERR = 0x0008,
|
|
POLLHUP = 0x0010,
|
|
POLLNVAL = 0x0020,
|
|
|
|
POLLSTANDARD = (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|
|
|
POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
|
|
}
|
|
}
|
|
else version (DragonFlyBSD)
|
|
{
|
|
enum
|
|
{
|
|
POLLIN = 0x0001,
|
|
POLLPRI = 0x0002,
|
|
POLLOUT = 0x0004,
|
|
POLLRDNORM = 0x0040,
|
|
POLLWRNORM = POLLOUT,
|
|
POLLRDBAND = 0x0080,
|
|
POLLWRBAND = 0x0100,
|
|
//POLLEXTEND = 0x0200,
|
|
//POLLATTRIB = 0x0400,
|
|
//POLLNLINK = 0x0800,
|
|
//POLLWRITE = 0x1000,
|
|
POLLERR = 0x0008,
|
|
POLLHUP = 0x0010,
|
|
POLLNVAL = 0x0020,
|
|
|
|
POLLSTANDARD = (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|
|
|
POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
|
|
}
|
|
}
|
|
else version (Solaris)
|
|
{
|
|
enum
|
|
{
|
|
POLLIN = 0x0001,
|
|
POLLPRI = 0x0002,
|
|
POLLOUT = 0x0004,
|
|
POLLRDNORM = 0x0040,
|
|
POLLWRNORM = POLLOUT,
|
|
POLLRDBAND = 0x0080,
|
|
POLLWRBAND = 0x0100,
|
|
POLLERR = 0x0008,
|
|
POLLHUP = 0x0010,
|
|
POLLNVAL = 0x0020,
|
|
}
|
|
}
|
|
else
|
|
{
|
|
static assert(false, "Unsupported platform");
|
|
}
|