mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-08 19:54:13 +08:00
Add more assertions
This commit is contained in:
parent
8a136d973e
commit
6639a87763
12
include/xy.h
12
include/xy.h
@ -7,7 +7,7 @@
|
|||||||
* Contributors : Null Nil <null@nil.com>
|
* Contributors : Null Nil <null@nil.com>
|
||||||
* |
|
* |
|
||||||
* Created on : <2023-08-28>
|
* Created on : <2023-08-28>
|
||||||
* Last modified : <2024-06-14>
|
* Last modified : <2024-06-21>
|
||||||
*
|
*
|
||||||
* xy: 襄阳、咸阳
|
* xy: 襄阳、咸阳
|
||||||
* Corss-Platform C utilities for CLI applications in Ruby flavor
|
* Corss-Platform C utilities for CLI applications in Ruby flavor
|
||||||
@ -16,7 +16,7 @@
|
|||||||
#ifndef XY_H
|
#ifndef XY_H
|
||||||
#define XY_H
|
#define XY_H
|
||||||
|
|
||||||
#define _XY_Version "v0.1.2-2024/06/14"
|
#define _XY_Version "v0.1.2.3-2024/06/21"
|
||||||
#define _XY_Maintain_URL "https://gitee.com/RubyMetric/chsrc/blob/main/include/xy.h"
|
#define _XY_Maintain_URL "https://gitee.com/RubyMetric/chsrc/blob/main/include/xy.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -71,10 +71,14 @@ void print (const char *s) { printf ("%s", s); }
|
|||||||
void println (const char *s) { printf ("%s\n", s);}
|
void println (const char *s) { printf ("%s\n", s);}
|
||||||
void say (const char *s) { printf ("%s\n", s);}
|
void say (const char *s) { printf ("%s\n", s);}
|
||||||
|
|
||||||
#define xy_arylen(x) (sizeof (x) / sizeof (x[0]))
|
|
||||||
|
|
||||||
#define assert_str(a, b) assert (xy_streql ((a), (b)))
|
#define assert_str(a, b) assert (xy_streql ((a), (b)))
|
||||||
|
|
||||||
|
#define xy_unsupport assert(!"Unsuppoted")
|
||||||
|
#define xy_unimplement assert(!"Unimplemented temporarily")
|
||||||
|
#define xy_unreach assert(!"This code shouldn't be reached")
|
||||||
|
|
||||||
|
#define xy_arylen(x) (sizeof (x) / sizeof (x[0]))
|
||||||
|
|
||||||
static inline void *
|
static inline void *
|
||||||
xy_malloc0 (size_t size)
|
xy_malloc0 (size_t size)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user