Skip to content
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

Added Windows DLL support #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chris-pikul
Copy link

Hello all, I quickly setup the MSVC project for compiling to a DLL for Windows installation.

The changes this makes:

  • Adds new msvc folder that is separate and contains the Visual Studio 2022 solution
  • Adds preprocessor guarded changes to pg_uuidv7.c for WIN32 targets only to allow:
    • Patching clock_gettime for Windows
    • Adding PGDLLEXPORT for each exported function

I have built, installed, and tested this extension on Postgres 16 Windows 11 x64 with no issue.

The .sql and .control where un-changed.

@fboulnois
Copy link
Owner

I'm not a huge fan of adding Visual Studio specific build files or adding a Windows-specific version of clock_gettime, although Windows support is useful.

Would cross-compiling be an option? If so, this could avoid the clock_gettime dependency. If not, perhaps there's a solution using timespec_get or the Postgres built-in version of gettimeofday?

For the Windows build, perhaps a batch file could work instead? This is more portable, and is how luajit does it, for example.

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