Skip to content

Commit

Permalink
Merge pull request #54 from kazatsuyu/build-msvc
Browse files Browse the repository at this point in the history
Enable build by msvc
  • Loading branch information
Himujjal authored Feb 7, 2024
2 parents 697bb51 + e93ae73 commit bd60db7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
"-std=c++14"
],
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14'
},
"msvs_settings": {
"VCCLCompilerTool": {
"AdditionalOptions": [
'-utf-8'
],
},
}
}
],
Expand Down
1 change: 1 addition & 0 deletions bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fn main() {
let dir: PathBuf = ["src"].iter().collect();
cc::Build::new()
.include(&dir)
.flag_if_supported("-utf-8")
.file(dir.join("parser.c"))
.file(dir.join("scanner.c"))
.compile("tree-sitter-svelte");
Expand Down
5 changes: 5 additions & 0 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,17 @@ bool scan(Scanner *scanner, TSLexer *lexer, const bool *valid_symbols) {
return false;
}

#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#endif
void deleter(void *tag, za_Allocator *A) {}
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#pragma clang diagnostic pop
#endif

void *tree_sitter_svelte_external_scanner_create() {
za_Allocator *A = za_New();
Scanner *scanner = (Scanner *)za_Alloc(A, sizeof(Scanner));
Expand Down

0 comments on commit bd60db7

Please sign in to comment.