Skip to content

fixed mkdir issue on Windows#17

Merged
osorensen merged 2 commits intomainfrom
windows-build-issue
Apr 10, 2025
Merged

fixed mkdir issue on Windows#17
osorensen merged 2 commits intomainfrom
windows-build-issue

Conversation

@osorensen
Copy link
Copy Markdown
Owner

No description provided.

@osorensen osorensen requested a review from Copilot April 10, 2025 12:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/parameter_tracer.cpp
if(trace) {
#ifdef _WIN32
// On Windows, mkdir takes only one argument
int status = mkdir(trace_directory.c_str());
Copy link

Copilot AI Apr 10, 2025

Choose a reason for hiding this comment

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

On Windows, consider using _mkdir from <direct.h> instead of mkdir; this will ensure compatibility with MSVC.

Suggested change
int status = mkdir(trace_directory.c_str());
int status = _mkdir(trace_directory.c_str());

Copilot uses AI. Check for mistakes.
Comment thread src/parameter_tracer.cpp
ParameterTracer::ParameterTracer(bool trace, bool trace_latent, const std::string& trace_directory)
: trace { trace }, trace_latent { trace_latent }, trace_directory { trace_directory } {
if(trace) {
#ifdef _WIN32
Copy link

Copilot AI Apr 10, 2025

Choose a reason for hiding this comment

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

When using _mkdir, include the header <direct.h> in the Windows-specific branch to ensure the function is declared.

Suggested change
#ifdef _WIN32
#ifdef _WIN32
#include <direct.h>

Copilot uses AI. Check for mistakes.
@osorensen osorensen merged commit b5cf170 into main Apr 10, 2025
5 checks passed
@osorensen osorensen deleted the windows-build-issue branch April 10, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants