summaryrefslogtreecommitdiff
path: root/tco.h
diff options
context:
space:
mode:
authorAiden Gall <aiden@aidengall.xyz>2025-02-09 18:02:15 +0000
committerAiden Gall <aiden@aidengall.xyz>2025-02-09 18:02:15 +0000
commitd52282ec3292a1e366d3837e56ef1fb5f07ce178 (patch)
treef3b52e1d2aa44fd88808ab9da6530df3ffee0935 /tco.h
initial commit
Diffstat (limited to 'tco.h')
-rw-r--r--tco.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/tco.h b/tco.h
new file mode 100644
index 0000000..c8a2f3d
--- /dev/null
+++ b/tco.h
@@ -0,0 +1,23 @@
+/* Copyright (C) 2025 Aiden Gall
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#if defined(__GNUC__) || defined(__clang__)
+#define coroutine __attribute__((noinline))
+#else
+#define coroutine
+#endif
+
+int tco_go(void (*f)(void));
+void tco_yield(void);