Skip to content

Initial changes for Windows compatibility #3824

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Foadsf
Copy link

@Foadsf Foadsf commented Mar 18, 2025

Windows Compatibility: Initial Changes

This PR introduces initial changes to make Taskwarrior build on Windows with MSVC:

Changes made:

  • Modified CXXSniffer.cmake to correctly detect C++17 support on MSVC
  • Modified CMakeLists.txt to use Windows native UUID APIs instead of libuuid
  • Made initial changes to header files for cross-platform compatibility

Next steps (not part of this PR):

  • Create platform-specific implementations for POSIX functionality
  • Add Windows-specific equivalents for Unix headers
  • Address remaining platform-specific code patterns

This is the first step toward making Taskwarrior truly cross-platform and compiler-agnostic. These changes do not affect functionality on Unix/Linux platforms.

Copy link
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

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

The libshared update is to a revision that doesn't exist, so I'm not sure what the idea is there?

This looks good so far. We should definitely add a Windows GitHub action to check we don't break this support.

#include <windows.h>
// Windows-specific user info implementation will be needed
// Create a pwd.h equivalent for Windows
#else
#include <pwd.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This, and unistd.h, appears to be unused and could just be removed.

// Define uuid_t for Windows compatibility
typedef UUID uuid_t;
#ifndef uuid_unparse_lower
void uuid_unparse_lower(uuid_t uu, char* out);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This shouldn't be necessary if HAVE_UUID_UNPARSE_LOWER is unset correctly.

@djmitche
Copy link
Collaborator

djmitche commented May 3, 2025

@Foadsf will you be able to continue this work?

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