www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Getting setjmp to work

reply Stewart Gordon <smjg_1998 yahoo.com> writes:
I've noticed that there have been a few old threads on setjmp, but has 
anybody actually got it to work in D?

I've some code that compiles and links, but it just throws an AV (under 
DMD 0.175, Windows 98SE).  See the attachment.

There are two aspects to it.  The first is translating setjmp.h itself 
into something that basically works.  The second is garbage collection. 
  Where does one find the stack copied by setjmp in order to add it as a 
GC root?

(For the curious ones among you, I'm experimenting with compiling 
Unlambda into D.  With the help of setjmp, if only it could be got to 
work and support GC, I think I could get the implementation of the c 
builtin working properly.)

Stewart.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-  C++  a->--- UB  P+ L E  W++  N+++ o K-  w++  O? M V? PS- 
PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y
------END GEEK CODE BLOCK------

My e-mail is valid but not my primary mailbox.  Please keep replies on 
the 'group where everyone may benefit.
Nov 28 2006
parent Sean Kelly <sean f4.ca> writes:
Stewart Gordon wrote:
 I've noticed that there have been a few old threads on setjmp, but has 
 anybody actually got it to work in D?
Not under Windows, but I've been told it works on Linux. I've been meaning to give the DMC implementation a look and see if anything jumps out at me (pun intended). Sean
Nov 28 2006