summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/runtime.in
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/runtime.in')
-rw-r--r--Build/source/utils/asymptote/runtime.in83
1 files changed, 45 insertions, 38 deletions
diff --git a/Build/source/utils/asymptote/runtime.in b/Build/source/utils/asymptote/runtime.in
index 542378bbe53..49e6de4d3eb 100644
--- a/Build/source/utils/asymptote/runtime.in
+++ b/Build/source/utils/asymptote/runtime.in
@@ -85,6 +85,10 @@ stringarray2* => stringArray2()
#include "process.h"
#include "arrayop.h"
+#ifdef __APPLE__
+extern "C" int isnan(double);
+#endif
+
#if defined(USEGC) && defined(GC_DEBUG) && defined(GC_BACKTRACE)
extern "C" {
void *GC_generate_random_valid_address(void);
@@ -233,6 +237,11 @@ bool :boolFalse()
return false;
}
+bool isnan(real x)
+{
+ return isnan(x);
+}
+
array* :pushNullArray()
{
return 0;
@@ -963,47 +972,45 @@ guide *reverse(guide *g)
size_t n=f.size();
bool cyclic=g->cyclic();
guidevector v;
- if(n >= 0) {
- size_t start=cyclic ? n : n-1;
- knot curr=f.Nodes(start);
- knot next;
- for(size_t i=start; i > 0; --i) {
- next=f.Nodes(i-1);
- v.push_back(new pairguide(curr.z));
- if(next.out->controlled()) {
- assert(curr.in->controlled());
- v.push_back(new controlguide(curr.in->control(),next.out->control()));
- } else {
- pair d=curr.in->dir();
- if(d != zero)
- v.push_back(new specguide(new dirSpec(-d),camp::OUT));
- else {
- real C=curr.in->curl();
- if(C >= 0.0)
- v.push_back(new specguide(new curlSpec(C),camp::OUT));
- }
- real tout=curr.tin.val;
- real tin=next.tout.val;
- bool atleast=next.tout.atleast;
- if(tout != 1.0 || tin != 1.0 || next.tout.atleast)
- v.push_back(new tensionguide(tensionSpecifier(tout,tin,atleast)));
- d=next.out->dir();
- if(d != zero)
- v.push_back(new specguide(new dirSpec(-d),camp::IN));
- else {
- real C=next.out->curl();
- if(C >= 0.0)
- v.push_back(new specguide(new curlSpec(C),camp::IN));
- }
+ size_t start=cyclic ? n : n-1;
+ knot curr=f.Nodes(start);
+ knot next;
+ for(size_t i=start; i > 0; --i) {
+ next=f.Nodes(i-1);
+ v.push_back(new pairguide(curr.z));
+ if(next.out->controlled()) {
+ assert(curr.in->controlled());
+ v.push_back(new controlguide(curr.in->control(),next.out->control()));
+ } else {
+ pair d=curr.in->dir();
+ if(d != zero)
+ v.push_back(new specguide(new dirSpec(-d),camp::OUT));
+ else {
+ real C=curr.in->curl();
+ if(C >= 0.0)
+ v.push_back(new specguide(new curlSpec(C),camp::OUT));
+ }
+ real tout=curr.tin.val;
+ real tin=next.tout.val;
+ bool atleast=next.tout.atleast;
+ if(tout != 1.0 || tin != 1.0 || next.tout.atleast)
+ v.push_back(new tensionguide(tensionSpecifier(tout,tin,atleast)));
+ d=next.out->dir();
+ if(d != zero)
+ v.push_back(new specguide(new dirSpec(-d),camp::IN));
+ else {
+ real C=next.out->curl();
+ if(C >= 0.0)
+ v.push_back(new specguide(new curlSpec(C),camp::IN));
}
- curr=next;
}
- if(cyclic)
- v.push_back(new cycletokguide());
- else
- v.push_back(new pairguide(next.z));
-
+ curr=next;
}
+ if(cyclic)
+ v.push_back(new cycletokguide());
+ else
+ v.push_back(new pairguide(next.z));
+
return new multiguide(v);
}