Skip to content

Commit b605efc

Browse files
authored
[cling] Windows: Fix declaration for C99 and re-enable Gnu.C test
The test was failing for a reason that likely shouldn't be ignored. This reverts commit 5947e13. This is a rebased version of root-project/cling#174 by marsupial
1 parent c3e5c53 commit b605efc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

interpreter/cling/lib/Interpreter/Interpreter.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,12 @@ namespace cling {
507507
#else
508508
const char* Spec = "__clrcall";
509509
#endif
510+
const bool ParamNames = LangOpts.C99;
510511
Strm << Linkage << " " << Spec << " int (*__dllonexit("
511-
<< "int (" << Spec << " *f)(void**, void**), void**, void**))"
512-
"(void**, void**)";
512+
<< "int (" << Spec << " *f)(void**, void**),"
513+
<< "void**" << (ParamNames ? " a" : "") << ","
514+
<< "void**" << (ParamNames ? " b" : "")
515+
<< "))(void**, void**)";
513516
if (EmitDefinitions)
514517
Strm << " { __cxa_atexit((void(*)(void*))f, 0, __dso_handle);"
515518
" return f; }\n";

interpreter/cling/test/Driver/Gnu.C

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
//------------------------------------------------------------------------------
88

99
// RUN: cat %s | %cling -std=gnu99 -x c -Xclang -verify 2>&1 | FileCheck %s
10-
// RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++11 -Xclang -verify 2>&1 | FileCheck %s
1110
// RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++14 -Xclang -verify 2>&1 | FileCheck %s
1211
// RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++1z -Xclang -verify 2>&1 | FileCheck %s
13-
// UNSUPPORTED: system-windows
12+
13+
// RUN: cat %s | %cling --noruntime -D__STRICT_ANSI__ -std=gnu++11 -Xclang -verify 2>&1 | FileCheck %s
14+
// --noruntime is for Windows which cannot include VStudio C++ headers in C++11
1415

1516
#ifdef __cplusplus
1617
extern "C" int printf(const char*, ...);

0 commit comments

Comments
 (0)