Skip to content

Allow cross-building for Windows on newer compiler#1772

Merged
BareosBot merged 4 commits intobareos:masterfrom
arogge:dev/arogge/master/wincross-f40
Apr 19, 2024
Merged

Allow cross-building for Windows on newer compiler#1772
BareosBot merged 4 commits intobareos:masterfrom
arogge:dev/arogge/master/wincross-f40

Conversation

@arogge
Copy link
Member

@arogge arogge commented Apr 15, 2024

Implement some minor changes to build Bareos with a modern cross compiler.

NOTE: This PR requires #68 to be co-merged.
That other change is also required to make the backport PRs actually build.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Required backport PRs have been created
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

arogge added 2 commits April 15, 2024 18:28
the modern headers declare the VSS_E constants as HRESULT (signed) so we
should not cast to unsigned here.
@arogge arogge added this to the 24.0.0 milestone Apr 17, 2024
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

These changes all make sense to me. If it builds on the newer cross builder, then it can get merged.

# include "Win2003/vsbackup.h"

# define VSS_ERROR_OBJECT_ALREADY_EXISTS 0x8004230D
# define VSS_ERROR_OBJECT_ALREADY_EXISTS ((HRESULT)0x8004230D)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder where this was taken from. Its not listed as an official return value:

Maybe this was just trial & error ?
Its probably there for a good reason though, so we should not remove it.

GET_MEDIA_TYPES* pNewBuffer
= (GET_MEDIA_TYPES*)realloc(pGetMediaTypes, dwBufferSize);
if (pNewBuffer != pGetMediaTypes) {
if (pNewBuffer == NULL) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This was a nice double free.

@arogge arogge self-assigned this Apr 18, 2024
@BareosBot BareosBot merged commit 4206e19 into bareos:master Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants