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

Clean up lots of win32 crustiness #77

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

tari
Copy link
Contributor

@tari tari commented Sep 20, 2023

This builds on top of #74 to remove a lot of old crusty patterns that mostly relate to targeting Windows as a primary platform. Using CMake, vcpkg and C++17 features:

  • all uses of raw win32 APIs are removed in favor of standard C++
  • the COM interface is removed (nobody seems to care about it and making it work with cmake seems hard)
  • app signing on Windows doesn't depend on random prebuilt .lib files anymore (GMP will be automatically built from source if needed)
  • dependency on OpenSSL is removed in favor of shipping a public-domain implementation of MD5

tari and others added 6 commits September 3, 2023 18:13
When unable to parse an operand to something that appears
to be a macro, ensure the required string for the error message is
passed. Failing to do so causes undefined behavior when the error
message is formatted, and reliably crashes.

Fixes alberthdev#71.
Travis hasn't been truly free for open-source projects since 2021, and
is no longer used by this project.
This should permit unification of the makefile and msbuild projects.
Support building with cmake
This is unneeded after c++11, and broken from c++17.

Fixes alberthdev#73
Take the relative path of each automatically-discovered test case,
rather than the absolute path returned by file(GLOB). This makes the
test names much simpler.
tari added 13 commits October 1, 2023 09:11
This replaces TCHAR with explicit unicode and swaps windows-specific
types like DWORD with standard equivalents, as well as removing the COM
interface.
This is a peculiar windows idiom for precompiled headers
that isn't important to us.
CMake should be used going forward.
c++17's std::filesystem allows us to get rid of some mess using either
bare win32 or POSIX APIs depending on the target platform. The code is
easier to understand and shorter.
"consider using sprintf_s instead" and the like is not helpful because
it's not portable.
This removes the dependency on the Windows cryptography libraries and
OpenSSL, at the cost of including a little bit more code.
This allows cmake to use PKG_CONFIG without any other installs.
microsoft/vcpkg#17481
This avoids including Windows.h except where actually required, and deletes
more uses of windows type names like WORD. bitmap.cpp is normalized to use
the windows names because it uses them extensively, but it no longer includes
Windows.h. Some former DWORDs that were incorrectly converted to int32_t are
changed to be unsigned again.
In particular this requests UTF-8 mode for versions of Windows that support
using the UTF-8 codepage. This is useful because it allows us to use bytestrings
and assume they're always UTF-8, without needing to deal with the mess that is
Windows wide characters and UCS-2 being completely unusable for non-BMP characters.
We don't actually care, but it's still probably useful to enable -Wall.
If textual output ends up containing garbage, we'd like to know.
This will display badly-encoded data if we find it, making
that somewhat easier to debug.
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