From 8ac44bd509628146d6fd75823a009245ca87fc00 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Wed, 25 Dec 2024 21:47:47 -0600 Subject: [PATCH] wip --- c/assert.h | 11 +++++++++++ c/assert_dreamcast.h | 3 +++ c/assert_hosted.h | 3 +++ c/debug_class_file.c | 1 - c/printf.h | 11 +++++++++++ c/printf_dreamcast.c | 0 c/printf_hosted.h | 6 ++++++ p/Fields.java | 11 +++++++++++ p/Generic.java | 22 ++++++++++++++++++++++ 9 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 c/assert.h create mode 100644 c/assert_dreamcast.h create mode 100644 c/assert_hosted.h create mode 100644 c/printf.h create mode 100644 c/printf_dreamcast.c create mode 100644 c/printf_hosted.h create mode 100644 p/Fields.java create mode 100644 p/Generic.java diff --git a/c/assert.h b/c/assert.h new file mode 100644 index 0000000..d708512 --- /dev/null +++ b/c/assert.h @@ -0,0 +1,11 @@ +#pragma once + +#if defined(__linux__) +#include "assert_hosted.h" +#elif defined(_WIN32) +#include "assert_hosted.h" +#elif defined(__APPLE__) +#include "assert_hosted.h" +#else +#include "assert_dreamcast.h" +#endif diff --git a/c/assert_dreamcast.h b/c/assert_dreamcast.h new file mode 100644 index 0000000..cdf3044 --- /dev/null +++ b/c/assert_dreamcast.h @@ -0,0 +1,3 @@ +#pragma once + +#define assert(b) diff --git a/c/assert_hosted.h b/c/assert_hosted.h new file mode 100644 index 0000000..7cf48a1 --- /dev/null +++ b/c/assert_hosted.h @@ -0,0 +1,3 @@ +#pragma once + +#include diff --git a/c/debug_class_file.c b/c/debug_class_file.c index 4f10a56..3dff509 100644 --- a/c/debug_class_file.c +++ b/c/debug_class_file.c @@ -1,4 +1,3 @@ -#include #include #include #include diff --git a/c/printf.h b/c/printf.h new file mode 100644 index 0000000..6a53840 --- /dev/null +++ b/c/printf.h @@ -0,0 +1,11 @@ +#pragma once + +#if defined(__linux__) +#include "printf_hosted.h" +#elif defined(_WIN32) +#include "printf_hosted.h" +#elif defined(__APPLE__) +#include "printf_hosted.h" +#else +#include "printf_dreamcast.h" +#endif diff --git a/c/printf_dreamcast.c b/c/printf_dreamcast.c new file mode 100644 index 0000000..e69de29 diff --git a/c/printf_hosted.h b/c/printf_hosted.h new file mode 100644 index 0000000..1e6b64e --- /dev/null +++ b/c/printf_hosted.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +#define debugf(fmt, ...) printf((fmt), __VA_ARGS__); +#define debugc(c) putc(stdout, c); diff --git a/p/Fields.java b/p/Fields.java new file mode 100644 index 0000000..bef791f --- /dev/null +++ b/p/Fields.java @@ -0,0 +1,11 @@ +package p; + +class Fields { + int foo; + long bar; + int[] spam; + static float baz; + static float bleh; + static double qux; + static Object eggs; +} diff --git a/p/Generic.java b/p/Generic.java new file mode 100644 index 0000000..c33b9ee --- /dev/null +++ b/p/Generic.java @@ -0,0 +1,22 @@ +package p; + +class Generic +{ + T obj1; // An object of type T + U obj2; // An object of type U + + // constructor + Generic(T obj1, U obj2) + { + this.obj1 = obj1; + this.obj2 = obj2; + } + + // To print objects of T and U + public static void print() + { + float ff = 1.0f; + Float f = new Float(f); + Generic g = new Generic(1, f); + } +}