Skip to content

Commit 6cd1037

Browse files
authored
Get VSCode working with Linux and WSL (#116)
1 parent e0566c9 commit 6cd1037

File tree

4 files changed

+45
-165
lines changed

4 files changed

+45
-165
lines changed

.vscode/c_cpp_properties.json

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"configurations": [
33
{
4-
"name": "Linux",
4+
"name": "Win32",
55
"includePath": [
66
"${workspaceFolder}"
77
],
88
"cStandard": "c11",
99
"cppStandard": "c++11",
10-
"compilerPath": "${workspaceFolder}/o/third_party/gcc/bin/x86_64-linux-musl-gcc",
1110
"forcedInclude": ["${workspaceFolder}/.vscode/vscode.h"],
1211
"defines": [
1312
"libcesque=",
@@ -63,6 +62,50 @@
6362
"attributeallocalign(x)=",
6463
"nullterminated(x)="
6564
]
65+
},
66+
{
67+
"name": "Linux",
68+
"includePath": [
69+
"${workspaceFolder}"
70+
],
71+
"cStandard": "gnu17",
72+
"compilerPath": "${workspaceFolder}/o/third_party/gcc/bin/x86_64-linux-musl-gcc",
73+
"compilerArgs": [
74+
"-Wall",
75+
"-Werror",
76+
"-fdebug-prefix-map=${workspaceFolder}=",
77+
"-frecord-gcc-switches",
78+
"-Wa,-W",
79+
"-Wa,-I.",
80+
"-Wa,--noexecstack",
81+
"-Wa,--nocompress-debug-sections",
82+
"-Og",
83+
"-g",
84+
"-gdescribe-dies",
85+
"-msse3",
86+
"-mno-red-zone",
87+
"-fno-math-errno",
88+
"-fno-trapping-math",
89+
"-fno-fp-int-builtin-inexact",
90+
"-fno-ident",
91+
"-fno-common",
92+
"-fno-gnu-unique",
93+
"-fstrict-aliasing",
94+
"-fstrict-overflow",
95+
"-fno-semantic-interposition",
96+
"-mno-omit-leaf-frame-pointer",
97+
"-fno-jump-tables",
98+
"-nostdinc",
99+
"-iquote."
100+
],
101+
"forcedInclude": [
102+
"libc/integral/normalize.inc"
103+
],
104+
"defines": [
105+
"COSMO",
106+
"MODE=",
107+
"IMAGE_BASE_VIRTUAL=0x400000"
108+
]
66109
}
67110
],
68111
"version": 4

.vscode/vscode.h

Lines changed: 0 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -1,159 +1,2 @@
11
#define __VSCODE_INTELLISENSE__ 1
22
#include "libc/integral/normalize.inc"
3-
4-
#if 0
5-
#define __VSCODE_INTELLISENSE__ 1
6-
#define __BIGGEST_ALIGNMENT__ 1
7-
#define __CHAR_MAX__ 0x7F
8-
#define __SCHAR_MAX__ __CHAR_MAX__
9-
#define __SHRT_MAX__ 0x7FFF
10-
#define __INT_MAX__ 0x7FFFFFFF
11-
#define __LONG_MAX__ 0x7FFFFFFFFFFFFFFF
12-
#define __LONG_LONG_MAX__ __LONG_MAX__
13-
#define __CHAR_MIN__ -((__CHAR_MAX__) + 1)
14-
#define __SHRT_MIN__ -((__SHRT_MAX__) + 1)
15-
#define __INT_MIN__ -((__INT_MAX__) + 1)
16-
#define __LONG_MIN__ -((__LONG_MAX__) + 1)
17-
#define __LONG_LONG_MIN__ -((__LONG_LONG_MAX__) + 1)
18-
#define __UCHAR_MAX__ 0xFF
19-
#define __USHRT_MAX__ 0xFFFF
20-
#define __UINT_MAX__ 0xFFFFFFFF
21-
#define __ULONG_MAX__ 0xFFFFFFFFFFFFFFFF
22-
#define __SIZE_MAX__ __ULONG_MAX__
23-
#define __SSIZE_MAX__ __LONG_MAX__
24-
#define __UINTPTR_MAX__ __SIZE_MAX__
25-
#define __INTPTR_MAX__ __SSIZE_MAX__
26-
#define __WCHAR_MAX__ __UINT_MAX__
27-
#define __PTRDIFF_MAX__ __UINTPTR_MAX__
28-
#define __INTMAX_MAX__ __ULONG_MAX__
29-
#define __SIZEOF_POINTER__ 8
30-
#define __SIZEOF_SHORT__ 2
31-
#define __SIZEOF_INT__ 4
32-
#define __SIZEOF_LONG__ 8
33-
#define __SIZEOF_LONG_LONG__ 8
34-
#define __SIZEOF_PTRDIFF_T__ 8
35-
#define __SIZEOF_SIZE_T__ 8
36-
#define __SIZEOF_WCHAR_T__ 4
37-
#define __SIZEOF_WINT_T__ 4
38-
#define __SIZEOF_FLOAT__ 4
39-
#define __SIZEOF_FLOAT128__ 16
40-
#define __SIZEOF_DOUBLE__ 8
41-
#define __SIZEOF_FLOAT80__ 10
42-
#define __SIZEOF_LONG_DOUBLE__ 16
43-
#define __FLT_MAX__ 1
44-
#define __DBL_MAX__ 1
45-
46-
#define __INT_LEAST8_TYPE__ signed char
47-
#define __INT_LEAST16_TYPE__ signed short
48-
#define __INT_LEAST32_TYPE__ signed int
49-
#define __INT_LEAST64_TYPE__ signed long long
50-
#define __UINT_LEAST8_TYPE__ unsigned char
51-
#define __UINT_LEAST16_TYPE__ unsigned short
52-
#define __UINT_LEAST32_TYPE__ unsigned int
53-
#define __UINT_LEAST64_TYPE__ unsigned long long
54-
55-
#define __UINT8_MAX__ __UCHAR_MAX__
56-
#define __UINT16_MAX__ __USHRT_MAX__
57-
#define __UINT32_MAX__ __UINT_MAX__
58-
#define __UINT64_MAX__ __ULONG_MAX__
59-
60-
#define __INT8_MAX__ __CHAR_MAX__
61-
#define __INT16_MAX__ __SHRT_MAX__
62-
#define __INT32_MAX__ __INT_MAX__
63-
#define __INT64_MAX__ __LONG_MAX__
64-
65-
#define ATEXIT_MAX 1
66-
#define STACKSIZE 0x10000
67-
#define ARG_MAX 255
68-
#define OPEN_MAX 0x7FFF
69-
#define CHAR_BIT 7
70-
#define NSIG 1
71-
#define NULL (0)
72-
#define false 0
73-
#define true (!(false))
74-
#define COSMOPOLITAN_C_START_
75-
#define COSMOPOLITAN_C_END_
76-
#define PAGESIZE 0x1000
77-
#define BIGPAGESIZE 0x10000
78-
#define NAME_MAX 255
79-
80-
#define SWITCHEROO(...) 0
81-
82-
extern unsigned __log_level;
83-
84-
typedef void * va_list;
85-
86-
#define va_start(...) 0
87-
#define va_end(...) 0
88-
#define va_arg(x, y) (y)(0)
89-
90-
typedef signed char int8_t;
91-
typedef signed short int16_t;
92-
typedef signed int int32_t;
93-
#define int64_t long long
94-
#define int128_t int64_t
95-
typedef unsigned char uint8_t;
96-
typedef unsigned short uint16_t;
97-
typedef unsigned int uint32_t;
98-
typedef unsigned long long uint64_t;
99-
typedef unsigned long long uint128_t;
100-
101-
typedef int errno_t;
102-
typedef uint64_t size_t;
103-
typedef unsigned long long ssize_t;
104-
typedef uint64_t uintptr_t;
105-
typedef long long intptr_t;
106-
107-
typedef unsigned long long uintmax_t;
108-
typedef long long intmax_t;
109-
110-
typedef uint32_t bool32;
111-
112-
#ifndef __cplusplus
113-
typedef uint8_t bool;
114-
typedef uint16_t char16_t;
115-
typedef uint32_t char32_t;
116-
#endif /* __cplusplus */
117-
118-
typedef char32_t wint_t;
119-
typedef char32_t wchar_t;
120-
typedef struct { int ax, dx; } axdx_t;
121-
122-
/* duplicate and replace xmmintrin.internal.h to fix it for IntelliSense
123-
* SEE: <> */
124-
125-
#define _Vector_size(x) __attribute__((__vector_size__(x)))
126-
127-
#define IMAGE_BASE_VIRTUAL 0x400000
128-
#define __SIGACTION(...) (0)
129-
#define VEIL(x, y) (y)
130-
#define STATIC_YOINK(x)
131-
#define BUFSIZ 1
132-
#define FRAMESIZE 0x10000
133-
#define PATH_MAX 252
134-
#define concat(x, y, z) 0
135-
#define CONCAT(a, b, c, d, e) 0
136-
#define shuffle(...) 0
137-
#define reverse(x, y) 0
138-
#define autotype(x) intptr_t
139-
140-
#define _Generic_(...) (void*)(0)
141-
#define _Generic(...) _Generic_
142-
#define _Alignas(...)
143-
#define _Section(...)
144-
145-
#define offsetof(x, y) 0
146-
#define INITIALIZER(...) struct _dummy
147-
#define __far
148-
#define BENCHLOOP(...) 0
149-
150-
#ifdef __hook
151-
#undef __hook
152-
#endif /* __hook */
153-
154-
#ifdef UriKeyval
155-
#undef UriKeyval
156-
#endif /* UriKeyval */
157-
158-
#define _Static_assert(...) 0
159-
#endif /* 0 */

libc/integral/llp64.inc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@
5555
#define __CHAR16_TYPE__ short unsigned int
5656
#define __CHAR32_TYPE__ unsigned int
5757
#define __WINT_TYPE__ unsigned int
58-
#define __CHAR16_TYPE__ short unsigned int
59-
#define __WCHAR_TYPE__ int
60-
#define __CHAR32_TYPE__ unsigned int
6158

6259
#define __INT_LEAST8_TYPE__ __INT8_TYPE__
6360
#define __UINT_LEAST8_TYPE__ __UINT8_TYPE__

libc/integral/lp64.inc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
#define __CHAR16_TYPE__ short unsigned int
4747
#define __CHAR32_TYPE__ unsigned int
4848
#define __WINT_TYPE__ unsigned int
49-
#define __CHAR16_TYPE__ short unsigned int
50-
#define __WCHAR_TYPE__ int
51-
#define __CHAR32_TYPE__ unsigned int
5249

5350
#define __INT_LEAST8_TYPE__ __INT8_TYPE__
5451
#define __UINT_LEAST8_TYPE__ __UINT8_TYPE__

0 commit comments

Comments
 (0)