File tree 2 files changed +51
-7
lines changed
2 files changed +51
-7
lines changed Original file line number Diff line number Diff line change 1
1
# NOTE(ref: based-on-sorbet): Based on Sorbet's common/os package.
2
2
cc_library (
3
3
name = "os" ,
4
- srcs = [
5
- "Os.h" ,
6
- "Os.cc" ,
7
- ] + select ({
8
- "@platforms//os:linux" : ["Linux.cc" ],
9
- "@platforms//os:macos" : ["macOS.cc" ],
10
- }),
4
+ srcs = glob (["*.cc" , "*.h" ], allow_empty = False ),
11
5
hdrs = [
12
6
"Os.h" ,
13
7
],
Original file line number Diff line number Diff line change
1
+ #ifdef _WIN32
2
+
3
+ #include < string>
4
+
5
+ #include < libloaderapi.h>
6
+ #include < processthreadsapi.h>
7
+ #include < windows.h>
8
+ #include < windef.h>
9
+
10
+ #include " indexer/os/Os.h"
11
+
12
+ namespace scip_clang {
13
+
14
+ std::string exec (std::string cmd) {
15
+ // FIXME(def: windows-support) Implement this if needed for addr2line
16
+ return " " ;
17
+ }
18
+
19
+ std::string addr2line (std::string_view programName, void const *const *addr,
20
+ int count) {
21
+ // FIXME(def: windows-support)
22
+ return " " ;
23
+ }
24
+
25
+ std::string getProgramName () {
26
+ char buf[MAX_PATH];
27
+ GetModuleFileNameA (nullptr , buf, MAX_PATH);
28
+ return buf;
29
+ }
30
+
31
+ bool setCurrentThreadName (std::string_view name) {
32
+ std::wstring wstr = std::wstring (name.begin (), name.end ());
33
+ SetThreadDescription (GetCurrentThread (), wstr.c_str ());
34
+ return true ;
35
+ }
36
+
37
+ bool amIBeingDebugged () {
38
+ // FIXME(def: windows-support)
39
+ return false ;
40
+ }
41
+
42
+ bool stopInDebugger () {
43
+ // FIXME(def: windows-support)
44
+ return false ;
45
+ }
46
+
47
+ } // namespace scip_clang
48
+
49
+
50
+ #endif
You can’t perform that action at this time.
0 commit comments