mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: C++ compiler support - Part 1
This commit is contained in:
parent
8aba3eaa07
commit
8dc0c5a699
@ -2884,6 +2884,9 @@ fn (mut g Gen) comp_if_to_ifdef(name string, is_comptime_optional bool) string {
|
||||
'msvc' {
|
||||
return '_MSC_VER'
|
||||
}
|
||||
'cplusplus' {
|
||||
return '__cplusplus'
|
||||
}
|
||||
// other:
|
||||
'debug' {
|
||||
return '_VDEBUG'
|
||||
|
@ -65,8 +65,14 @@ const (
|
||||
c_headers = '
|
||||
|
||||
// c_headers
|
||||
typedef int (*qsort_callback_func)(const void*, const void*);
|
||||
#include <stdio.h> // TODO remove all these includes, define all function signatures and types manually
|
||||
#include <stdlib.h>
|
||||
#ifdef __cplusplus
|
||||
#include <utility>
|
||||
#define _MOV std::move
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
//#include "fns.h"
|
||||
#include <signal.h>
|
||||
@ -370,11 +376,13 @@ typedef map map_int;
|
||||
typedef map map_string;
|
||||
typedef byte array_fixed_byte_300 [300];
|
||||
typedef byte array_fixed_byte_400 [400];
|
||||
#ifndef __cplusplus
|
||||
#ifndef bool
|
||||
typedef int bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
'
|
||||
bare_c_headers = '
|
||||
|
Loading…
Reference in New Issue
Block a user