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' {
|
'msvc' {
|
||||||
return '_MSC_VER'
|
return '_MSC_VER'
|
||||||
}
|
}
|
||||||
|
'cplusplus' {
|
||||||
|
return '__cplusplus'
|
||||||
|
}
|
||||||
// other:
|
// other:
|
||||||
'debug' {
|
'debug' {
|
||||||
return '_VDEBUG'
|
return '_VDEBUG'
|
||||||
|
@ -65,8 +65,14 @@ const (
|
|||||||
c_headers = '
|
c_headers = '
|
||||||
|
|
||||||
// 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 <stdio.h> // TODO remove all these includes, define all function signatures and types manually
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#include <utility>
|
||||||
|
#define _MOV std::move
|
||||||
|
#include <execinfo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//#include "fns.h"
|
//#include "fns.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -370,11 +376,13 @@ typedef map map_int;
|
|||||||
typedef map map_string;
|
typedef map map_string;
|
||||||
typedef byte array_fixed_byte_300 [300];
|
typedef byte array_fixed_byte_300 [300];
|
||||||
typedef byte array_fixed_byte_400 [400];
|
typedef byte array_fixed_byte_400 [400];
|
||||||
|
#ifndef __cplusplus
|
||||||
#ifndef bool
|
#ifndef bool
|
||||||
typedef int bool;
|
typedef int bool;
|
||||||
#define true 1
|
#define true 1
|
||||||
#define false 0
|
#define false 0
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
'
|
'
|
||||||
bare_c_headers = '
|
bare_c_headers = '
|
||||||
|
Loading…
Reference in New Issue
Block a user