Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Try to address build issues #4 #5 and #6

Add #include "unistd.h"
Remove obsolete types/rect.cpp
Add #include to static_error.cpp
circa.h has a MSVC alternative for stdbool
  • Loading branch information...
commit 7156d16baeef2c05bb27e1355329087509e450ed 1 parent 7d4206b
@paulhodge paulhodge authored
View
9 include/circa/circa.h
@@ -3,8 +3,17 @@
#ifndef CIRCA_H_INCLUDED
#define CIRCA_H_INCLUDED
+#ifdef _MSC_VER
+
+// No stdbool.h in Visual Studio :(
+typedef int bool;
+
+#else
+
#include <stdbool.h>
+#endif
+
// Public API
#ifdef __cplusplus
View
1  include/circa/internal/for_hosted_funcs.h
@@ -29,7 +29,6 @@
#include "../../../src/update_cascades.h"
#include "../../../src/types/point.h"
-#include "../../../src/types/rect_i.h"
#include "../../../src/types/ref.h"
View
6 src/command_line.cpp
@@ -1,6 +1,10 @@
// Copyright (c) Andrew Fischer. See LICENSE file for license terms.
#include "common_headers.h"
+
+// for sleep():
+#include <unistd.h>
+
#include "branch.h"
#include "building.h"
#include "kernel.h"
@@ -185,6 +189,8 @@ int run_command_line(caWorld* world, caValue* args)
evaluate_branch(&context, &branch);
+ // Sleep for 1 second before next iteration. This is silly, it should either
+ // iterate more quickly or have a smarter way to know when to loop.
sleep(1);
}
}
View
2  src/functions/static_error.cpp
@@ -1,5 +1,7 @@
// Copyright (c) Andrew Fischer. See LICENSE file for license terms.
+#include "circa/internal/for_hosted_funcs.h"
+
namespace circa {
namespace static_error_function {
View
7 src/kernel.cpp
@@ -41,7 +41,6 @@
#include "types/int.h"
#include "types/name.h"
#include "types/number.h"
-#include "types/rect_i.h"
#include "types/ref.h"
#include "types/set.h"
#include "types/void.h"
@@ -785,9 +784,9 @@ CA_FUNCTION(Term__source_location)
if (t == NULL)
return RAISE_ERROR("NULL reference");
- Rect_i* output = Rect_i::cast(OUTPUT);
- output->set(t->sourceLoc.col, t->sourceLoc.line,
- t->sourceLoc.colEnd, t->sourceLoc.lineEnd);
+ circa_set_vec4(circa_output(STACK, 0),
+ t->sourceLoc.col, t->sourceLoc.line,
+ t->sourceLoc.colEnd, t->sourceLoc.lineEnd);
}
CA_FUNCTION(Term__global_id)
{
View
13 src/types/rect.cpp
@@ -1,13 +0,0 @@
-// Copyright (c) Andrew Fischer. See LICENSE file for license terms.
-
-namespace circa {
-
-void get_rect(caValue* val, float* x1, float* y1, float* x2, float* y2)
-{
- *x1 = to_float(get_index(val, 0));
- *y1 = to_float(get_index(val, 1));
- *x2 = to_float(get_index(val, 2));
- *y2 = to_float(get_index(val, 3));
-}
-
-} // namespace circa
View
7 src/types/rect.h
@@ -1,7 +0,0 @@
-// Copyright (c) Andrew Fischer. See LICENSE file for license terms.
-
-namespace circa {
-
-void get_rect(caValue* val, float* x1, float* y1, float* x2, float* y2);
-
-};
View
24 src/types/rect_i.cpp
@@ -1,24 +0,0 @@
-// Copyright (c) Andrew Fischer. See LICENSE file for license terms.
-
-#include "circa/internal/for_hosted_funcs.h"
-
-#include "rect_i.h"
-
-namespace circa {
-
-void Rect_i::set(int x1, int y1, int x2, int y2)
-{
- set_int(get_index(this, 0), x1);
- set_int(get_index(this, 1), y1);
- set_int(get_index(this, 2), x2);
- set_int(get_index(this, 3), y2);
-}
-
-Rect_i* Rect_i::cast(caValue* tv)
-{
- create(unbox_type(RECT_I_TYPE_TERM), tv);
- return (Rect_i*) tv;
-}
-
-
-} // namespace circa
View
13 src/types/rect_i.h
@@ -1,13 +0,0 @@
-// Copyright (c) Andrew Fischer. See LICENSE file for license terms.
-
-#pragma once
-
-namespace circa {
-
-struct Rect_i : caValue
-{
- void set(int x1, int y1, int x2, int y2);
- static Rect_i* cast(caValue* tv);
-};
-
-} // namespace circa
Please sign in to comment.
Something went wrong with that request. Please try again.