-
Notifications
You must be signed in to change notification settings - Fork 0
3600: AVRO-4221: [C++] Allow using symbol visibility annotations also on non-Windows platforms #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,15 +26,15 @@ | |
|
|
||
| namespace avro { | ||
|
|
||
| class AVRO_DECL InputStream; | ||
| class InputStream; | ||
|
|
||
| /// This class is used to implement an avro spec parser using a flex/bison | ||
| /// compiler. In order for the lexer to be reentrant, this class provides a | ||
| /// lexer object for each parse. The bison parser also uses this class to | ||
| /// build up an avro parse tree as the avro spec is parsed. | ||
|
|
||
| class AVRO_DECL Name; | ||
| class AVRO_DECL ValidSchema; | ||
| class Name; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing 🤖 Was this useful? React with 👍 or 👎
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:annoying; category:bug; feedback:The Augment AI reviewer is not correct! The AVRO_DECL macro should be used where the class is defined, i.e. for |
||
| class ValidSchema; | ||
|
|
||
| /// Given a stream containing a JSON schema, compiles the schema to a | ||
| /// ValidSchema object. Throws if the schema cannot be compiled to a valid | ||
|
|
@@ -60,7 +60,7 @@ AVRO_DECL ValidSchema compileJsonSchemaFromString(const std::string &input); | |
|
|
||
| AVRO_DECL ValidSchema compileJsonSchemaFromFile(const char *filename); | ||
|
|
||
| AVRO_DECL ValidSchema compileJsonSchemaWithNamedReferences(std::istream &is, | ||
| AVRO_DECL ValidSchema compileJsonSchemaWithNamedReferences(std::istream &is, | ||
| const std::map<Name, ValidSchema> &namedReferences); | ||
|
|
||
| } // namespace avro | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,17 +21,29 @@ | |
|
|
||
| // Windows DLL support | ||
|
|
||
| #ifdef _WIN32 | ||
| #ifdef _MSC_VER | ||
| #pragma warning(disable : 4275 4251) | ||
| #endif // _MSC_VER | ||
|
|
||
| #if defined _WIN32 || defined __CYGWIN__ | ||
| #define AVRO_DLL_EXPORT __declspec(dllexport) | ||
| #define AVRO_DLL_IMPORT __declspec(dllimport) | ||
| #define AVRO_DLL_HIDDEN | ||
| #else | ||
| #define AVRO_DLL_EXPORT [[gnu::visibility("default")]] | ||
| #define AVRO_DLL_IMPORT [[gnu::visibility("default")]] | ||
| #define AVRO_DLL_HIDDEN [[gnu::visibility("hidden")]] | ||
| #endif // _WIN32 || __CYGWIN__ | ||
|
Comment on lines
+28
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Inspect the actual Config.hh file to see the current state
cat "lang/c++/include/avro/Config.hh" | head -50Repository: martin-augment/avro Length of output: 1612 🏁 Script executed: #!/bin/bash
# Search for C++ standard requirements
fd -e cmake . | xargs grep -n "CMAKE_CXX_STANDARD\|CXX_STANDARD" 2>/dev/null || echo "No CMake C++ standard found"
echo "---"
# Check README for compiler requirements
fd -e md README . 2>/dev/null | head -5 | xargs -I {} cat {} | grep -i "c++\|compiler\|require" -A 2 -B 2 2>/dev/null || echo "No README compiler info found"Repository: martin-augment/avro Length of output: 2895 Ensure C++17 minimum version is explicitly enforced in the build configuration. The code uses the newer standard C and C++ syntax using '[[...]]' with the 'gnu::' prefix, which requires C++17 or later. The code properly handles Windows platforms with conditional compilation, but the CMake configuration lacks an explicit 🤖 Prompt for AI Agents
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:useful; category:bug; feedback:The CodeRabbit AI reviewer is correct! The AvroCpp project requires C++17 - https://github.com/apache/avro/blob/99c7379ce62d002daca4d94b975afabc725df024/lang/c%2B%2B/CMakeLists.txt#L24 and everything is OK. |
||
|
|
||
| #if defined(AVRO_DYN_LINK) | ||
| #ifdef AVRO_DYN_LINK | ||
| #ifdef AVRO_SOURCE | ||
| #define AVRO_DECL __declspec(dllexport) | ||
| #define AVRO_DECL AVRO_DLL_EXPORT | ||
| #else | ||
| #define AVRO_DECL __declspec(dllimport) | ||
| #define AVRO_DECL AVRO_DLL_IMPORT | ||
| #endif // AVRO_SOURCE | ||
| #endif // AVRO_DYN_LINK | ||
|
|
||
| #ifdef _WIN32 | ||
| #include <intsafe.h> | ||
| using ssize_t = SSIZE_T; | ||
| #endif // _WIN32 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeToStringis now declared withAVRO_DECL, but its definition inimpl/json/JsonDom.ccappears to be compiled without includingJsonDom.hh, so the visibility/export annotation may not be applied to the definition in the library TU. This can matter when building the shared library with hidden-by-default visibility, where consumers would then fail to link againsttypeToString.🤖 Was this useful? React with 👍 or 👎
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value:annoying; category:bug; feedback:The Augment AI reviewer is not correct! JsonDom.cc includes JsonDom.hh at https://github.com/apache/avro/blob/52938d00107626aaedbafb2ea9e9fb50f3b95138/lang/c%2B%2B/impl/json/JsonDom.cc#L19