Gitweb links:

...log 
http://git.netsurf-browser.org/libnsutils.git/shortlog/73215930a3f45735ddc31b439111e575d73ab6f3
...commit 
http://git.netsurf-browser.org/libnsutils.git/commit/73215930a3f45735ddc31b439111e575d73ab6f3
...tree 
http://git.netsurf-browser.org/libnsutils.git/tree/73215930a3f45735ddc31b439111e575d73ab6f3

The branch, master has been updated
       via  73215930a3f45735ddc31b439111e575d73ab6f3 (commit)
      from  b320babd590a54588a3f568aa31f854133e850f2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/libnsutils.git/commit/?id=73215930a3f45735ddc31b439111e575d73ab6f3
commit 73215930a3f45735ddc31b439111e575d73ab6f3
Author: Michael Drake <michael.dr...@codethink.co.uk>
Commit: Michael Drake <michael.dr...@codethink.co.uk>

    Assert: Add static assertion macro.
    
    We're not C11 so we can't use static_assert().

diff --git a/Makefile b/Makefile
index f62bf69..6236b73 100644
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,7 @@ include $(NSBUILD)/Makefile.top
 
 # Extra installation rules
 I := /$(INCLUDEDIR)/nsutils
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/assert.h
 INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/errors.h
 INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/base64.h
 INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/endian.h
diff --git a/include/nsutils/assert.h b/include/nsutils/assert.h
new file mode 100644
index 0000000..0f8f14d
--- /dev/null
+++ b/include/nsutils/assert.h
@@ -0,0 +1,24 @@
+/*
+ * This file is part of LibNSUtils.
+ * Licensed under the MIT License,
+ *                http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2022 Michael Drake <t...@netsurf-browser.org>
+ */
+
+/**
+ * \file
+ * Static assertion macro.
+ */
+
+#ifndef NSUTILS_ASSERT_H__
+#define NSUTILS_ASSERT_H__
+
+/** Compile time assertion macro. */
+#define ns_static_assert(e) \
+{ \
+       enum { \
+               cyaml_static_assert_check = 1 / (!!(e)) \
+       }; \
+}
+
+#endif


-----------------------------------------------------------------------

Summary of changes:
 Makefile                 |    1 +
 include/nsutils/assert.h |   24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 include/nsutils/assert.h

diff --git a/Makefile b/Makefile
index f62bf69..6236b73 100644
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,7 @@ include $(NSBUILD)/Makefile.top
 
 # Extra installation rules
 I := /$(INCLUDEDIR)/nsutils
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/assert.h
 INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/errors.h
 INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/base64.h
 INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/endian.h
diff --git a/include/nsutils/assert.h b/include/nsutils/assert.h
new file mode 100644
index 0000000..0f8f14d
--- /dev/null
+++ b/include/nsutils/assert.h
@@ -0,0 +1,24 @@
+/*
+ * This file is part of LibNSUtils.
+ * Licensed under the MIT License,
+ *                http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2022 Michael Drake <t...@netsurf-browser.org>
+ */
+
+/**
+ * \file
+ * Static assertion macro.
+ */
+
+#ifndef NSUTILS_ASSERT_H__
+#define NSUTILS_ASSERT_H__
+
+/** Compile time assertion macro. */
+#define ns_static_assert(e) \
+{ \
+       enum { \
+               cyaml_static_assert_check = 1 / (!!(e)) \
+       }; \
+}
+
+#endif


-- 
NetSurf generalised utility library
_______________________________________________
netsurf-commits mailing list -- netsurf-commits@netsurf-browser.org
To unsubscribe send an email to netsurf-commits-le...@netsurf-browser.org

Reply via email to