Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Mar 2021 09:23:43 +0000 (UTC)
From:      Dave Cottlehuber <dch@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r569453 - in head/lang/zig: . files
Message-ID:  <202103290923.12T9NhLp053822@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dch
Date: Mon Mar 29 09:23:43 2021
New Revision: 569453
URL: https://svnweb.freebsd.org/changeset/ports/569453

Log:
  lang/zig: backport syslog functions from master
  
  These will eventually land in zig 0.8.0
  
  Sponsored by:	SkunkWerks, GmbH

Added:
  head/lang/zig/files/
  head/lang/zig/files/patch-lib_std_c.zig   (contents, props changed)
  head/lang/zig/files/patch-lib_std_os_bits.zig   (contents, props changed)
  head/lang/zig/files/patch-lib_std_os_bits_freebsd.zig   (contents, props changed)
Modified:
  head/lang/zig/Makefile

Modified: head/lang/zig/Makefile
==============================================================================
--- head/lang/zig/Makefile	Mon Mar 29 09:19:29 2021	(r569452)
+++ head/lang/zig/Makefile	Mon Mar 29 09:23:43 2021	(r569453)
@@ -2,6 +2,7 @@
 
 PORTNAME=	zig
 DISTVERSION=	0.7.1
+PORTREVISION=	1
 CATEGORIES=	lang
 MASTER_SITES=	https://ziglang.org/download/${DISTVERSION}/ \
 		https://ziglang.org/builds/

Added: head/lang/zig/files/patch-lib_std_c.zig
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/zig/files/patch-lib_std_c.zig	Mon Mar 29 09:23:43 2021	(r569453)
@@ -0,0 +1,23 @@
+--- lib/std/c.zig.orig	2020-12-13 19:14:58 UTC
++++ lib/std/c.zig
+@@ -346,3 +346,20 @@ pub extern "c" fn prctl(option: c_int, ...) c_int;
+ 
+ pub extern "c" fn getrlimit(resource: rlimit_resource, rlim: *rlimit) c_int;
+ pub extern "c" fn setrlimit(resource: rlimit_resource, rlim: *const rlimit) c_int;
++
++pub extern "c" fn fmemopen(noalias buf: ?*c_void, size: usize, noalias mode: [*:0]const u8) ?*FILE;
++
++pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void;
++pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void;
++pub extern "c" fn closelog() void;
++pub extern "c" fn setlogmask(maskpri: c_int) c_int;
++
++pub const max_align_t = if (std.Target.current.abi == .msvc)
++    f64
++else if (std.Target.current.isDarwin())
++    c_longdouble
++else
++    extern struct {
++        a: c_longlong,
++        b: c_longdouble,
++    };

Added: head/lang/zig/files/patch-lib_std_os_bits.zig
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/zig/files/patch-lib_std_os_bits.zig	Mon Mar 29 09:23:43 2021	(r569453)
@@ -0,0 +1,25 @@
+--- lib/std/os/bits.zig.orig	2020-12-13 19:14:58 UTC
++++ lib/std/os/bits.zig
+@@ -34,3 +34,22 @@ pub const iovec_const = extern struct {
+     iov_base: [*]const u8,
+     iov_len: usize,
+ };
++
++// syslog
++
++/// system is unusable
++pub const LOG_EMERG = 0;
++/// action must be taken immediately
++pub const LOG_ALERT = 1;
++/// critical conditions
++pub const LOG_CRIT = 2;
++/// error conditions
++pub const LOG_ERR = 3;
++/// warning conditions
++pub const LOG_WARNING = 4;
++/// normal but significant condition
++pub const LOG_NOTICE = 5;
++/// informational
++pub const LOG_INFO = 6;
++/// debug-level messages
++pub const LOG_DEBUG = 7;

Added: head/lang/zig/files/patch-lib_std_os_bits_freebsd.zig
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/zig/files/patch-lib_std_os_bits_freebsd.zig	Mon Mar 29 09:23:43 2021	(r569453)
@@ -0,0 +1,24 @@
+--- lib/std/os/bits/freebsd.zig.orig	2020-12-13 19:14:58 UTC
++++ lib/std/os/bits/freebsd.zig
+@@ -15,6 +15,7 @@ pub const gid_t = u32;
+ pub const mode_t = c_uint;
+ 
+ pub const socklen_t = u32;
++pub const suseconds_t = c_long;
+ 
+ /// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
+ pub const Kevent = extern struct {
+@@ -159,6 +160,13 @@ pub const libc_stat = extern struct {
+ pub const timespec = extern struct {
+     tv_sec: isize,
+     tv_nsec: isize,
++};
++
++pub const timeval = extern struct {
++    /// seconds
++    tv_sec: time_t,
++    /// microseconds
++    tv_usec: suseconds_t,
+ };
+ 
+ pub const dirent = extern struct {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103290923.12T9NhLp053822>