annotate run/bug_20041226_E.d @ 248:ae135d48d8b5

fixed version check for pre 0.106 DMD versions
author thomask
date Mon, 24 Jan 2005 20:11:13 +0000
parents 249516e487f9
children f9e1d827a255
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
219
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
1 // $HeadURL$
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
2 // $Date$
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
3 // $Author$
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
4
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
5 // @author@ h3r3tic <foo@bar.baz>
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
6 // @date@ 2004-12-26
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
7 // @uri@ news:cqmufn$26oj$1@digitaldaemon.com
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
8 // @url@ nntp://digitalmars.com/digitalmars.D.bugs/2606
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
9
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
10 // __DSTRESS_DFLAGS__ -inline
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
11
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
12 module dstress.run.bug_20041226_E;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
13
248
ae135d48d8b5 fixed version check for pre 0.106 DMD versions
thomask
parents: 219
diff changeset
14 version(none){
ae135d48d8b5 fixed version check for pre 0.106 DMD versions
thomask
parents: 219
diff changeset
15 import std.stdio;
ae135d48d8b5 fixed version check for pre 0.106 DMD versions
thomask
parents: 219
diff changeset
16 }else{
219
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
17 void writefln(...){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
18 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
19 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
20
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
21 struct vec3{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
22 vec3 opSub(vec3 a){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
23 vec3 x;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
24 return x;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
25 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
26 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
27
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
28 struct Face{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
29 vec3 a;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
30 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
31
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
32 struct Mesh{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
33 Face[] faces;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
34 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
35
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
36 struct GeomObject{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
37 Mesh mesh;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
38 char[] name;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
39 vec3 xlate;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
40 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
41
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
42 class AseLoader{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
43 this(){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
44 GeomObject go;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
45 go.name = "NODE";
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
46 geomObjects ~= go;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
47 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
48
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
49 GeomObject[] geomObjects;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
50 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
51
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
52
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
53 void extractTriangles(GeomObject geomObj){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
54 void foobar(){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
55 try{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
56 writefln("name: ", geomObj.name);
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
57
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
58 return;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
59 }catch(Object err){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
60 throw err;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
61 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
62 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
63
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
64 foobar();
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
65 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
66
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
67 int main(){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
68 try{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
69 AseLoader al = new AseLoader;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
70
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
71 foreach(GeomObject go; al.geomObjects){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
72 writefln("processing ", go.name);
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
73 extractTriangles(go);
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
74 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
75 }catch(Object err){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
76 writefln("Exception caught:", err);
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
77 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
78
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
79 return 0;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
80 }