c_cpp 22.c

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp 22.c相关的知识,希望对你有一定的参考价值。

#pragma once

#include <stdarg.h>
#include <stdbool.h>
#include <inttypes.h>

#pragma GCC  diagnostic error "-Wswitch"
#pragma GCC  diagnostic error "-Wconversion"
#pragma GCC  diagnostic error "-Wreturn-type"
#pragma GCC  diagnostic error "-Wuninitialized"
#pragma GCC  diagnostic error "-Wunused-result"
#define warn __attribute__((warn_unused_result))

typedef bool     b8;
typedef char     c8;
typedef int8_t   i8;
typedef uint8_t  u8;
typedef int16_t  i16;
typedef uint16_t u16;
typedef int32_t  i32;
typedef uint32_t u32;
typedef int64_t  i64;
typedef uint64_t u64;
typedef float    f32;
typedef double   f64;

#define address *
#define string c8 address
#define var __auto_type
#define let __auto_type const
#define case    break; case
#define default break; default
#define _Defer_merge(x, y) x##y
#define _Defer_var_name(x) _Defer_merge(_Defer_scope_var_, x)
#define defer(function, type, ...) __attribute__((cleanup(function))) \
 type _Defer_var_name(__COUNTER__) = __VA_ARGS__
#define forrange(index, start, stop) for(size_t index = start; index != stop; ++index)
#define foruntil(index, stop, array) for(size_t index = 0; (array)[index] != stop; ++index)
#define forcount(index, count) for(size_t index = 0, total = count; index < total; ++index)
#define countof(array) (sizeof(array) / sizeof((array)[0]))
#define streq(x, y) (!strcmp(x, y))

static inline void print(const string format, ...)
{
  va_list args;
  va_start(args, format);
  vprintf(format, args);
  printf("\n");
  va_end(args);
}

以上是关于c_cpp 22.c的主要内容,如果未能解决你的问题,请参考以下文章

Unix/Linux环境C编程新手教程(22) C/C++怎样获取程序的执行时间

torch/lib/libgomp-d22c30c5.so.1:无法在静态 TLS 块中分配内存

Algorithms - Strassen's algorithm for matrix multiplication 矩阵乘法 Strassen 算法

Algorithms - Strassen's algorithm for matrix multiplication 矩阵乘法 Strassen 算法

C++11新特性:22—— C++11引用限定符的用法

22)C语言之switch语句