public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Fix mcontext_t definitions for Darwin
@ 2021-10-15 19:33 Iain D Sandoe
0 siblings, 0 replies; 6+ messages in thread
From: Iain D Sandoe @ 2021-10-15 19:33 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:5a667586776e48a80ab95f3cbbe2138e95432049
commit 5a667586776e48a80ab95f3cbbe2138e95432049
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon Dec 7 15:42:09 2020 +0100
libphobos: Fix mcontext_t definitions for Darwin
Diff:
---
libphobos/src/std/datetime/package.d | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/libphobos/src/std/datetime/package.d b/libphobos/src/std/datetime/package.d
index 976d06ddb79..a5fd03d39e9 100644
--- a/libphobos/src/std/datetime/package.d
+++ b/libphobos/src/std/datetime/package.d
@@ -115,7 +115,6 @@ public import std.datetime.interval;
public import std.datetime.systime;
public import std.datetime.timezone;
-import core.exception : AssertError;
import std.functional : unaryFun;
import std.traits;
import std.typecons : Flag, Yes, No;
@@ -267,12 +266,7 @@ public:
StopWatch sw;
sw.start();
auto t1 = sw.peek();
- bool doublestart = true;
- try
- sw.start();
- catch (AssertError e)
- doublestart = false;
- assert(!doublestart);
+ assert(sw._flagStarted);
sw.stop();
assert((t1 - sw.peek()).to!("seconds", real)() <= 0);
}
@@ -294,12 +288,7 @@ public:
sw.start();
sw.stop();
auto t1 = sw.peek();
- bool doublestop = true;
- try
- sw.stop();
- catch (AssertError e)
- doublestop = false;
- assert(!doublestop);
+ assert(!sw._flagStarted);
assert((t1 - sw.peek()).to!("seconds", real)() == 0);
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Fix mcontext_t definitions for Darwin
@ 2021-10-18 15:54 Iain D Sandoe
0 siblings, 0 replies; 6+ messages in thread
From: Iain D Sandoe @ 2021-10-18 15:54 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:e343d790e148975c746edff155167755ac455155
commit e343d790e148975c746edff155167755ac455155
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon Dec 7 15:42:09 2020 +0100
libphobos: Fix mcontext_t definitions for Darwin
Diff:
---
libphobos/src/std/datetime/package.d | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/libphobos/src/std/datetime/package.d b/libphobos/src/std/datetime/package.d
index 976d06ddb79..a5fd03d39e9 100644
--- a/libphobos/src/std/datetime/package.d
+++ b/libphobos/src/std/datetime/package.d
@@ -115,7 +115,6 @@ public import std.datetime.interval;
public import std.datetime.systime;
public import std.datetime.timezone;
-import core.exception : AssertError;
import std.functional : unaryFun;
import std.traits;
import std.typecons : Flag, Yes, No;
@@ -267,12 +266,7 @@ public:
StopWatch sw;
sw.start();
auto t1 = sw.peek();
- bool doublestart = true;
- try
- sw.start();
- catch (AssertError e)
- doublestart = false;
- assert(!doublestart);
+ assert(sw._flagStarted);
sw.stop();
assert((t1 - sw.peek()).to!("seconds", real)() <= 0);
}
@@ -294,12 +288,7 @@ public:
sw.start();
sw.stop();
auto t1 = sw.peek();
- bool doublestop = true;
- try
- sw.stop();
- catch (AssertError e)
- doublestop = false;
- assert(!doublestop);
+ assert(!sw._flagStarted);
assert((t1 - sw.peek()).to!("seconds", real)() == 0);
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Fix mcontext_t definitions for Darwin
@ 2021-10-13 8:30 Iain D Sandoe
0 siblings, 0 replies; 6+ messages in thread
From: Iain D Sandoe @ 2021-10-13 8:30 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:5ee68d9d2555de7b134f6a217ae3d965ce2e51f0
commit 5ee68d9d2555de7b134f6a217ae3d965ce2e51f0
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon Dec 7 15:42:09 2020 +0100
libphobos: Fix mcontext_t definitions for Darwin
Diff:
---
libphobos/src/std/datetime/package.d | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/libphobos/src/std/datetime/package.d b/libphobos/src/std/datetime/package.d
index 976d06ddb79..a5fd03d39e9 100644
--- a/libphobos/src/std/datetime/package.d
+++ b/libphobos/src/std/datetime/package.d
@@ -115,7 +115,6 @@ public import std.datetime.interval;
public import std.datetime.systime;
public import std.datetime.timezone;
-import core.exception : AssertError;
import std.functional : unaryFun;
import std.traits;
import std.typecons : Flag, Yes, No;
@@ -267,12 +266,7 @@ public:
StopWatch sw;
sw.start();
auto t1 = sw.peek();
- bool doublestart = true;
- try
- sw.start();
- catch (AssertError e)
- doublestart = false;
- assert(!doublestart);
+ assert(sw._flagStarted);
sw.stop();
assert((t1 - sw.peek()).to!("seconds", real)() <= 0);
}
@@ -294,12 +288,7 @@ public:
sw.start();
sw.stop();
auto t1 = sw.peek();
- bool doublestop = true;
- try
- sw.stop();
- catch (AssertError e)
- doublestop = false;
- assert(!doublestop);
+ assert(!sw._flagStarted);
assert((t1 - sw.peek()).to!("seconds", real)() == 0);
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Fix mcontext_t definitions for Darwin
@ 2021-10-11 20:35 Iain D Sandoe
0 siblings, 0 replies; 6+ messages in thread
From: Iain D Sandoe @ 2021-10-11 20:35 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4407ffee91bf3d07dfa9f3278550541e80a1a195
commit 4407ffee91bf3d07dfa9f3278550541e80a1a195
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon Dec 7 15:42:09 2020 +0100
libphobos: Fix mcontext_t definitions for Darwin
Diff:
---
libphobos/src/std/datetime/package.d | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/libphobos/src/std/datetime/package.d b/libphobos/src/std/datetime/package.d
index 976d06ddb79..a5fd03d39e9 100644
--- a/libphobos/src/std/datetime/package.d
+++ b/libphobos/src/std/datetime/package.d
@@ -115,7 +115,6 @@ public import std.datetime.interval;
public import std.datetime.systime;
public import std.datetime.timezone;
-import core.exception : AssertError;
import std.functional : unaryFun;
import std.traits;
import std.typecons : Flag, Yes, No;
@@ -267,12 +266,7 @@ public:
StopWatch sw;
sw.start();
auto t1 = sw.peek();
- bool doublestart = true;
- try
- sw.start();
- catch (AssertError e)
- doublestart = false;
- assert(!doublestart);
+ assert(sw._flagStarted);
sw.stop();
assert((t1 - sw.peek()).to!("seconds", real)() <= 0);
}
@@ -294,12 +288,7 @@ public:
sw.start();
sw.stop();
auto t1 = sw.peek();
- bool doublestop = true;
- try
- sw.stop();
- catch (AssertError e)
- doublestop = false;
- assert(!doublestop);
+ assert(!sw._flagStarted);
assert((t1 - sw.peek()).to!("seconds", real)() == 0);
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Fix mcontext_t definitions for Darwin
@ 2020-12-21 20:36 Iain D Sandoe
0 siblings, 0 replies; 6+ messages in thread
From: Iain D Sandoe @ 2020-12-21 20:36 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:16f6a362abf9b3f61fc8b62d2be79a39eda558ec
commit 16f6a362abf9b3f61fc8b62d2be79a39eda558ec
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon Dec 7 15:42:09 2020 +0100
libphobos: Fix mcontext_t definitions for Darwin
Diff:
---
libphobos/libdruntime/core/sys/posix/ucontext.d | 119 ++++++++++++++++++++++--
libphobos/src/std/datetime/package.d | 15 +--
2 files changed, 114 insertions(+), 20 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/ucontext.d b/libphobos/libdruntime/core/sys/posix/ucontext.d
index ef74771a50d..9400edd11f2 100644
--- a/libphobos/libdruntime/core/sys/posix/ucontext.d
+++ b/libphobos/libdruntime/core/sys/posix/ucontext.d
@@ -920,16 +920,121 @@ else version (CRuntime_Musl)
}
else version (Darwin)
{
- alias mcontext_t = void;
+ private
+ {
+ version (X86_Any)
+ {
+ struct __darwin_mmst_reg
+ {
+ char[10] __mmst_reg;
+ char[6] __mmst_rsrv;
+ }
+
+ struct __darwin_xmm_reg
+ {
+ char[16] __xmm_reg;
+ }
+
+ struct __darwin_exception_state
+ {
+ uint __trapno;
+ uint __err;
+ version (X86_64)
+ ulong __faultvaddr;
+ else
+ uint __faultvaddr;
+ }
+
+ struct __darwin_thread_state
+ {
+ version (X86_64)
+ ulong[21] __regs;
+ else
+ uint[16] __regs;
+ }
+
+ struct __darwin_float_state
+ {
+ int[2] __fpu_reserved;
+ ushort __fpu_fcw;
+ ushort __fpu_fsw;
+ uint[7] __fpu_regs;
+ __darwin_mmst_reg[8] __fpu_stmm;
+ version (X86_64)
+ {
+ __darwin_xmm_reg[16] __fpu_xmm;
+ char[6*16] __fpu_rsrv4;
+ }
+ else
+ {
+ __darwin_xmm_reg[8] __fpu_xmm;
+ char[14*16] __fpu_rsrv4;
+ }
+ int __fpu_reserved1;
+ }
+
+ struct __darwin_mcontext
+ {
+ __darwin_exception_state __es;
+ __darwin_thread_state __ss;
+ __darwin_float_state __fs;
+ }
+ }
+ else version (PPC_Any)
+ {
+ struct __darwin_exception_state
+ {
+ uint __dar;
+ uint __dsisr;
+ uint __exception;
+ uint __pad0;
+ uint[4] __pad1;
+ }
+
+ struct __darwin_thread_state
+ {
+ uint[40] __regs;
+ }
+
+ struct __darwin_float_state
+ {
+ double[32] __fpregs;
+ uint __fpscr_pad;
+ uint __fpscr;
+ }
+
+ struct __darwin_vector_state
+ {
+ uint[32][4] __save_vr;
+ uint[4] __save_vscr;
+ uint[4] __save_pad5;
+ uint __save_vrvalid;
+ uint[7] __save_pad6;
+ }
+
+ struct __darwin_mcontext
+ {
+ __darwin_exception_state __es;
+ __darwin_thread_state __ss;
+ __darwin_float_state __fs;
+ __darwin_vector_state __vs;
+ }
+ }
+ else
+ static assert(false, "mcontext_t unimplemented for this platform.");
+ }
+
+ alias mcontext_t = __darwin_mcontext*;
struct ucontext
{
- int uc_onstack;
- sigset_t uc_sigmask;
- stack_t uc_stack;
- ucontext* uc_link;
- size_t uc_mcsize;
- mcontext_t* uc_mcontext;
+ int uc_onstack;
+ sigset_t uc_sigmask;
+ stack_t uc_stack;
+ ucontext* uc_link;
+ size_t uc_mcsize;
+ __darwin_mcontext* uc_mcontext;
+ __darwin_mcontext __mcontext_data;
}
alias ucontext_t = ucontext;
diff --git a/libphobos/src/std/datetime/package.d b/libphobos/src/std/datetime/package.d
index 976d06ddb79..a5fd03d39e9 100644
--- a/libphobos/src/std/datetime/package.d
+++ b/libphobos/src/std/datetime/package.d
@@ -115,7 +115,6 @@ public import std.datetime.interval;
public import std.datetime.systime;
public import std.datetime.timezone;
-import core.exception : AssertError;
import std.functional : unaryFun;
import std.traits;
import std.typecons : Flag, Yes, No;
@@ -267,12 +266,7 @@ public:
StopWatch sw;
sw.start();
auto t1 = sw.peek();
- bool doublestart = true;
- try
- sw.start();
- catch (AssertError e)
- doublestart = false;
- assert(!doublestart);
+ assert(sw._flagStarted);
sw.stop();
assert((t1 - sw.peek()).to!("seconds", real)() <= 0);
}
@@ -294,12 +288,7 @@ public:
sw.start();
sw.stop();
auto t1 = sw.peek();
- bool doublestop = true;
- try
- sw.stop();
- catch (AssertError e)
- doublestop = false;
- assert(!doublestop);
+ assert(!sw._flagStarted);
assert((t1 - sw.peek()).to!("seconds", real)() == 0);
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Fix mcontext_t definitions for Darwin
@ 2020-12-13 17:43 Iain D Sandoe
0 siblings, 0 replies; 6+ messages in thread
From: Iain D Sandoe @ 2020-12-13 17:43 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:bf31d9946067bb285c4ff79dff8d17258da75495
commit bf31d9946067bb285c4ff79dff8d17258da75495
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon Dec 7 15:42:09 2020 +0100
libphobos: Fix mcontext_t definitions for Darwin
Diff:
---
libphobos/libdruntime/core/sys/posix/ucontext.d | 119 ++++++++++++++++++++++--
libphobos/src/std/datetime/package.d | 15 +--
2 files changed, 114 insertions(+), 20 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/ucontext.d b/libphobos/libdruntime/core/sys/posix/ucontext.d
index ef74771a50d..9400edd11f2 100644
--- a/libphobos/libdruntime/core/sys/posix/ucontext.d
+++ b/libphobos/libdruntime/core/sys/posix/ucontext.d
@@ -920,16 +920,121 @@ else version (CRuntime_Musl)
}
else version (Darwin)
{
- alias mcontext_t = void;
+ private
+ {
+ version (X86_Any)
+ {
+ struct __darwin_mmst_reg
+ {
+ char[10] __mmst_reg;
+ char[6] __mmst_rsrv;
+ }
+
+ struct __darwin_xmm_reg
+ {
+ char[16] __xmm_reg;
+ }
+
+ struct __darwin_exception_state
+ {
+ uint __trapno;
+ uint __err;
+ version (X86_64)
+ ulong __faultvaddr;
+ else
+ uint __faultvaddr;
+ }
+
+ struct __darwin_thread_state
+ {
+ version (X86_64)
+ ulong[21] __regs;
+ else
+ uint[16] __regs;
+ }
+
+ struct __darwin_float_state
+ {
+ int[2] __fpu_reserved;
+ ushort __fpu_fcw;
+ ushort __fpu_fsw;
+ uint[7] __fpu_regs;
+ __darwin_mmst_reg[8] __fpu_stmm;
+ version (X86_64)
+ {
+ __darwin_xmm_reg[16] __fpu_xmm;
+ char[6*16] __fpu_rsrv4;
+ }
+ else
+ {
+ __darwin_xmm_reg[8] __fpu_xmm;
+ char[14*16] __fpu_rsrv4;
+ }
+ int __fpu_reserved1;
+ }
+
+ struct __darwin_mcontext
+ {
+ __darwin_exception_state __es;
+ __darwin_thread_state __ss;
+ __darwin_float_state __fs;
+ }
+ }
+ else version (PPC_Any)
+ {
+ struct __darwin_exception_state
+ {
+ uint __dar;
+ uint __dsisr;
+ uint __exception;
+ uint __pad0;
+ uint[4] __pad1;
+ }
+
+ struct __darwin_thread_state
+ {
+ uint[40] __regs;
+ }
+
+ struct __darwin_float_state
+ {
+ double[32] __fpregs;
+ uint __fpscr_pad;
+ uint __fpscr;
+ }
+
+ struct __darwin_vector_state
+ {
+ uint[32][4] __save_vr;
+ uint[4] __save_vscr;
+ uint[4] __save_pad5;
+ uint __save_vrvalid;
+ uint[7] __save_pad6;
+ }
+
+ struct __darwin_mcontext
+ {
+ __darwin_exception_state __es;
+ __darwin_thread_state __ss;
+ __darwin_float_state __fs;
+ __darwin_vector_state __vs;
+ }
+ }
+ else
+ static assert(false, "mcontext_t unimplemented for this platform.");
+ }
+
+ alias mcontext_t = __darwin_mcontext*;
struct ucontext
{
- int uc_onstack;
- sigset_t uc_sigmask;
- stack_t uc_stack;
- ucontext* uc_link;
- size_t uc_mcsize;
- mcontext_t* uc_mcontext;
+ int uc_onstack;
+ sigset_t uc_sigmask;
+ stack_t uc_stack;
+ ucontext* uc_link;
+ size_t uc_mcsize;
+ __darwin_mcontext* uc_mcontext;
+ __darwin_mcontext __mcontext_data;
}
alias ucontext_t = ucontext;
diff --git a/libphobos/src/std/datetime/package.d b/libphobos/src/std/datetime/package.d
index 976d06ddb79..a5fd03d39e9 100644
--- a/libphobos/src/std/datetime/package.d
+++ b/libphobos/src/std/datetime/package.d
@@ -115,7 +115,6 @@ public import std.datetime.interval;
public import std.datetime.systime;
public import std.datetime.timezone;
-import core.exception : AssertError;
import std.functional : unaryFun;
import std.traits;
import std.typecons : Flag, Yes, No;
@@ -267,12 +266,7 @@ public:
StopWatch sw;
sw.start();
auto t1 = sw.peek();
- bool doublestart = true;
- try
- sw.start();
- catch (AssertError e)
- doublestart = false;
- assert(!doublestart);
+ assert(sw._flagStarted);
sw.stop();
assert((t1 - sw.peek()).to!("seconds", real)() <= 0);
}
@@ -294,12 +288,7 @@ public:
sw.start();
sw.stop();
auto t1 = sw.peek();
- bool doublestop = true;
- try
- sw.stop();
- catch (AssertError e)
- doublestop = false;
- assert(!doublestop);
+ assert(!sw._flagStarted);
assert((t1 - sw.peek()).to!("seconds", real)() == 0);
}
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-10-18 15:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 19:33 [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Fix mcontext_t definitions for Darwin Iain D Sandoe
-- strict thread matches above, loose matches on Subject: below --
2021-10-18 15:54 Iain D Sandoe
2021-10-13 8:30 Iain D Sandoe
2021-10-11 20:35 Iain D Sandoe
2020-12-21 20:36 Iain D Sandoe
2020-12-13 17:43 Iain D Sandoe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).