1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

make << work with appending arrays; PostgreSQL driver

This commit is contained in:
Alexander Medvednikov
2019-07-04 01:56:18 +02:00
parent fcf8909c75
commit 8f10e37370
11 changed files with 151 additions and 75 deletions

View File

@ -236,6 +236,7 @@ typedef map map_string;
//============================== HELPER C MACROS =============================*/
#define _PUSH(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array__push(arr, &tmp);}
#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array__push_many(arr, tmp.data, tmp.len);}
#define _IN(typ, val, arr) array_##typ##_contains(arr, val)
#define ALLOC_INIT(type, ...) (type *)memdup((type[]){ __VA_ARGS__ }, sizeof(type))
#define UTF8_CHAR_LEN( byte ) (( 0xE5000000 >> (( byte >> 3 ) & 0x1e )) & 3 ) + 1