summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlejandro Sior <aho@sior.be>2022-08-06 21:26:03 +0200
committerAlejandro Sior <aho@sior.be>2022-08-06 21:26:03 +0200
commita448a31cab64ab684a79bb179de7a859f8f9da1a (patch)
treeb6a61cde006eed7a5f81276c4a31dd909a7c057e /test
parent25027ef496681ff6f45386f98f9b81b465659e5b (diff)
cook: add preliminary MSVC C toolchain support
It cannot properly create and link against .DLLs yet, the current implementation of it is a hack (using mkextra). Static libraries, executables as well as cc work in a respectable manner.
Diffstat (limited to 'test')
-rw-r--r--test/.build8
-rw-r--r--test/hai.c8
-rw-r--r--test/hai.h3
-rw-r--r--test/main.c78
4 files changed, 19 insertions, 78 deletions
diff --git a/test/.build b/test/.build
index 96b8226..61983a3 100644
--- a/test/.build
+++ b/test/.build
@@ -1,3 +1,5 @@
-obj = cc("main.c")
-l = lib("vol", obj)
-aout = exe("vol", l, libs=["Xm", "Xt"]) \ No newline at end of file
+maino = cc("main.c")
+haio = cc("hai.c")
+hailib = shlib("hai", haio)
+
+aout = exe("vol", maino, hailib) \ No newline at end of file
diff --git a/test/hai.c b/test/hai.c
new file mode 100644
index 0000000..263a8de
--- /dev/null
+++ b/test/hai.c
@@ -0,0 +1,8 @@
+#include "hai.h"
+
+#include <stdio.h>
+
+__declspec(dllexport)
+void hai() {
+ printf("lol\n");
+} \ No newline at end of file
diff --git a/test/hai.h b/test/hai.h
new file mode 100644
index 0000000..5da3133
--- /dev/null
+++ b/test/hai.h
@@ -0,0 +1,3 @@
+__declspec(dllexport)
+void hai();
+// test \ No newline at end of file
diff --git a/test/main.c b/test/main.c
index 25c49da..3763706 100644
--- a/test/main.c
+++ b/test/main.c
@@ -1,81 +1,9 @@
-
#include <stdio.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/PushB.h>
-#include <Xm/ArrowB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/Form.h>
-
-int lol() {
- printf("yes!\n");
- return 0;
-}
+#include "hai.h"
int main(int argc, char **argv) {
- XtAppContext app;
- Widget toplevel = XtVaAppInitialize(&app, "Demo", NULL, 0, &argc, argv, NULL, NULL);
-
- /*Widget mainw = XtVaCreateManagedWidget("main_window",
- xmMainWindowWidgetClass, toplevel,
- XmNscrollBarDisplayPolicy, XmAS_NEEDED,
- XmNscrollingPolicy, XmAUTOMATIC,
- NULL);
-
- XmString file = XmStringCreateLocalized("File");
- XmString edit = XmStringCreateLocalized("Edit");
- Widget menu = XmVaCreateSimpleMenuBar(mainw, "menubar",
- XmVaCASCADEBUTTON, file, 'F',
- XmVaCASCADEBUTTON, edit, 'E',
- NULL);
- XmStringFree(edit);
- XmStringFree(file);
-
- XtManageChild(menu); */
-
- Widget form = XmVaCreateForm(toplevel, "form",
- XmNfractionBase, 90,
- NULL);
- XtManageChild(form);
-
- Widget left = XmVaCreateArrowButton(form, "voldown",
- XmNarrowDirection, XmARROW_LEFT,
- XmNtopAttachment, XmATTACH_FORM,
- XmNleftAttachment, XmATTACH_FORM,
- XmNbottomAttachment, XmATTACH_FORM,
- XmNrightAttachment, XmATTACH_POSITION,
- XmNrightPosition, 30,
- NULL);
- XtAddCallback(left, XmNactivateCallback, (XtCallbackProc)lol, NULL);
- XtAddCallback(left, XmNdisarmCallback, (XtCallbackProc)lol, NULL);
- XtManageChild(left);
-
-
- Widget pb = XmVaCreatePushButton(form, "Volume",
- XmNleftAttachment, XmATTACH_WIDGET,
- XmNleftWidget, left,
- XmNtopAttachment, XmATTACH_FORM,
- XmNbottomAttachment, XmATTACH_FORM,
- XmNrightAttachment, XmATTACH_POSITION,
- XmNrightPosition, 60,
- NULL);
- XtAddCallback(pb, XmNactivateCallback, (XtCallbackProc)lol, NULL);
- XtManageChild(pb);
-
- Widget right = XmVaCreateArrowButton(form, "volup",
- XmNarrowDirection, XmARROW_RIGHT,
- XmNleftAttachment, XmATTACH_WIDGET,
- XmNleftWidget, pb,
- XmNrightAttachment, XmATTACH_FORM,
- XmNtopAttachment, XmATTACH_FORM,
- XmNbottomAttachment, XmATTACH_FORM,
- NULL);
- XtAddCallback(right, XmNactivateCallback, (XtCallbackProc)lol, NULL);
- XtAddCallback(right, XmNdisarmCallback, (XtCallbackProc)lol, NULL);
- XtManageChild(right);
-
- XtRealizeWidget(toplevel);
- XtAppMainLoop(app);
+ printf("Hello world\n");
+ hai();
return 0;
}