Added a test app for setjmp() - doesn't work yet - strangely enough, the test
environment where I wrote our setjmp() in does work perfectly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14897 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,12 +4,14 @@ UsePrivateHeaders syslog_daemon ;
|
|||||||
|
|
||||||
SimpleTest SyslogTest
|
SimpleTest SyslogTest
|
||||||
: SyslogTest.cpp syslog.cpp
|
: SyslogTest.cpp syslog.cpp
|
||||||
: libroot.so
|
|
||||||
;
|
;
|
||||||
|
|
||||||
SimpleTest flock_test
|
SimpleTest flock_test
|
||||||
: flock_test.cpp
|
: flock_test.cpp
|
||||||
: libroot.so
|
;
|
||||||
|
|
||||||
|
SimpleTest setjmp_test
|
||||||
|
: setjmp_test.c
|
||||||
;
|
;
|
||||||
|
|
||||||
# Tell Jam where to find these sources
|
# Tell Jam where to find these sources
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Axel Dörfler, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <setjmp.h>
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
jmp_buf state;
|
||||||
|
int value;
|
||||||
|
|
||||||
|
if (value = setjmp(state)) {
|
||||||
|
printf("failed with: %d!\n", value);
|
||||||
|
} else {
|
||||||
|
printf("here I am: %d\n", value);
|
||||||
|
longjmp(state, 42);
|
||||||
|
printf("you won't see me!\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
puts("done.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user