Skip to content

doccaico/calc-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Usage

On terminal

$ zig fetch --save=calc-zig https://github.com/doccaico/calc-zig/archive/<HASH>.tar.gz
// build.zig

const calc_zig_dep = b.dependency("calc-zig", .{ .target = target, .optimize = optimize });
exe.linkLibrary(calc_zig_dep.artifact("calc"));

// main.zig

const std = @import("std");

const c = @cImport({
    @cInclude("calc-c/calc-c.h");
});

pub fn main() void {
    std.debug.print("{d}\n", .{c.add(1, 2)});
    std.debug.print("{d}\n", .{c.sub(10, 3)});
    std.debug.print("{s}\n", .{c.CALC_C_VERSION});
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages