Skip to content

Commit

Permalink
[cling] Windows: Fix declaration for C99 and re-enable Gnu.C test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ferdymercury authored Oct 15, 2024
1 parent c3e5c53 commit b605efc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions interpreter/cling/lib/Interpreter/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,12 @@ namespace cling {
#else
const char* Spec = "__clrcall";
#endif
const bool ParamNames = LangOpts.C99;
Strm << Linkage << " " << Spec << " int (*__dllonexit("
<< "int (" << Spec << " *f)(void**, void**), void**, void**))"
"(void**, void**)";
<< "int (" << Spec << " *f)(void**, void**),"
<< "void**" << (ParamNames ? " a" : "") << ","
<< "void**" << (ParamNames ? " b" : "")
<< "))(void**, void**)";
if (EmitDefinitions)
Strm << " { __cxa_atexit((void(*)(void*))f, 0, __dso_handle);"
" return f; }\n";
Expand Down
5 changes: 3 additions & 2 deletions interpreter/cling/test/Driver/Gnu.C
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
//------------------------------------------------------------------------------

// RUN: cat %s | %cling -std=gnu99 -x c -Xclang -verify 2>&1 | FileCheck %s
// RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++11 -Xclang -verify 2>&1 | FileCheck %s
// RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++14 -Xclang -verify 2>&1 | FileCheck %s
// RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++1z -Xclang -verify 2>&1 | FileCheck %s
// UNSUPPORTED: system-windows

// RUN: cat %s | %cling --noruntime -D__STRICT_ANSI__ -std=gnu++11 -Xclang -verify 2>&1 | FileCheck %s
// --noruntime is for Windows which cannot include VStudio C++ headers in C++11

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

0 comments on commit b605efc

Please sign in to comment.