Skip to content

Commit 8c743f7

Browse files
committed
zig lib building now
1 parent c085be4 commit 8c743f7

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn ensureZigVersion() !void {
5050
}
5151

5252
const c_args = [_][]const u8{
53-
"-D_MSC_VER",
53+
// "-D_MSC_VER",
5454
"-std=c11",
5555
"-fno-sanitize=undefined",
5656
};

labsound-c.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ overhead.
4747
// conflicts. The default is ls_1_0_ to indicate the 1.0 version of LabSound.
4848
//
4949
#ifndef LSNAMESPACE
50-
#define LSNAMESPACE ls_1_0_
50+
//#define LSNAMESPACE ls_1_0_
5151
#endif
5252

5353
// The LSCONCAT macro is used to apply a namespace to the symbols in the public
@@ -71,6 +71,7 @@ overhead.
7171
extern "C" {
7272
#endif
7373

74+
#ifdef LSNAMESPACE
7475
// forward declare the LabSound C types in a namespace
7576
#define ls_StringSlice LSCONCAT(LSNAMESPACE, StringSlice)
7677
#define ls_NameArray LSCONCAT(LSNAMESPACE, NameArray)
@@ -82,7 +83,7 @@ extern "C" {
8283
#define ls_BusData LSCONCAT(LSNAMESPACE, BusData)
8384
#define ls_PinKind LSCONCAT(LSNAMESPACE, PinKind)
8485
#define ls_PinDataType LSCONCAT(LSNAMESPACE, PinDataType)
85-
86+
#endif
8687

8788
typedef struct {
8889
const char* start;

src/main.zig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ pub fn main() anyerror!void {
1010
std.log.info("All your codebase are belong to us.", .{});
1111

1212
const oscillator_str = "Oscillator";
13-
var Oscillator_s = ls.ls_StringSlice {
13+
const Oscillator_s = ls.ls_StringSlice {
1414
.start = oscillator_str, .end = &oscillator_str[10],};
1515
const osc1_str = "osc1";
16-
var osc1_s = ls.ls_StringSlice {
16+
const osc1_s = ls.ls_StringSlice {
1717
.start = osc1_str, .end = &osc1_str[4], };
1818

19-
var api = ls.ls_create_api_1_0(ls.ls_default_alloc);
20-
var osc = api.*.node_create.?(api, osc1_s, Oscillator_s);
21-
var dest = api.*.device_node.?(api);
19+
const api = ls.ls_create_api_1_0(ls.ls_default_alloc);
20+
const osc = api.*.node_create.?(api, osc1_s, Oscillator_s);
21+
const dest = api.*.destination_node.?(api);
2222

23-
var oscOut = api.*.node_indexed_output.?(api, osc, 0);
24-
var destIn = api.*.node_indexed_input.?(api, dest, 0);
25-
//var connection1
26-
_ = api.*.connect_output_to_input.?(api, destIn, oscOut);
23+
const oscOut = api.*.node_indexed_output.?(api, osc, 0);
24+
const destIn = api.*.node_indexed_input.?(api, dest, 0);
25+
//const connection1
26+
_ = api.*.connect.?(api, destIn, oscOut);
2727

2828
api.*.node_start.?(api, osc, ls.ls_Seconds { .t = 0 });
2929
}

0 commit comments

Comments
 (0)