Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions plugins/logger/kafka_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include <osquery/remote/transports/tls.h>
// clang-format on

#ifdef _WIN32

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🟠 kafka_producer.cpp uses _WIN32 instead of the canonical WIN32 guard

Changed the platform guard in the top-of-file include block from #ifdef _WIN32 / #elif defined _unix_ to #ifdef WIN32 / #else, matching the canonical OSQUERY-010-2 WIN32 guard and ensuring <unistd.h> is included on all non-Windows builds instead of only on a never-defined _unix_ macro.

🤖 Prompt for AI agents
In plugins/logger/kafka_producer.cpp around line 17, review and complete this code-review fix: kafka_producer.cpp uses _WIN32 instead of the canonical WIN32 guard.
What the draft fix changed: Changed the platform guard in the top-of-file include block from `#ifdef _WIN32` / `#elif defined _unix_` to `#ifdef WIN32` / `#else`, matching the canonical OSQUERY-010-2 `WIN32` guard and ensuring `<unistd.h>` is included on all non-Windows builds instead of only on a never-defined `_unix_` macro.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer

#ifdef WIN32
#include <io.h>
#elif defined _unix_
#else
#include <unistd.h>
#endif

Expand Down Expand Up @@ -368,3 +368,4 @@ bool KafkaProducerPlugin::configureTopics() {
return true;
}
} // namespace osquery

Loading