Autoarr2 works now

This commit is contained in:
2022-06-02 20:33:13 +03:00
parent cb64df9218
commit 281befa1d7
13 changed files with 115 additions and 56 deletions

View File

@@ -9,10 +9,6 @@ extern "C" {
#include "errors.h"
#include "cptr.h"
#if __cplusplus
#include "errors.hpp"
#endif
// executes codeblock and prints execution time
#ifdef CLOCK_REALTIME // non-standard high-precision clock
#define optime(opname,repeats,codeblock) ({\

View File

@@ -1,9 +0,0 @@
#include "errors.hpp"
void throwcpp_id(ErrorId eid){
throwcpp_msg(errname(eid));
}
void throwcpp_msg(char* emsg){
__EXIT(emsg);
}

View File

@@ -24,7 +24,7 @@ typedef struct Maybe{
// return it if func doesn't return anything
// .value .errmsg
static const Maybe MaybeNull={UniNull, NULL};
#define MaybeNull (Maybe){UniNull, NULL}
void Maybe_free(Maybe e);
void printMaybe(Maybe e);
@@ -46,6 +46,10 @@ char* __unknownErr( );
default: __unknownErr\
)(E)
#if __cplusplus
#define throw_id(E) __EXIT(((char*)__genErrMsg(errname(E), __FILE__,__LINE__,__func__)))
#define throw_msg(E) __EXIT(((char*)__genErrMsg(E, __FILE__,__LINE__,__func__)))
#endif
#define throw(E) __EXIT(((char*)__genErrMsg((__stringify_err(E)), __FILE__,__LINE__,__func__)))
#define safethrow(E, FREEMEM) { FREEMEM; __RETURN_EXCEPTION(((char*)__genErrMsg((__stringify_err(E)), __FILE__,__LINE__,__func__))); }

View File

@@ -1,8 +0,0 @@
#pragma once
#ifdef __cplusplus
#include "errors.h"
void throwcpp_id(ErrorId eid);
void throwcpp_msg(char* emsg);
#endif