Skip to content

Commit

Permalink
Merge pull request #1772
Browse files Browse the repository at this point in the history
Allow cross-building for Windows on newer compiler
  • Loading branch information
BareosBot committed Apr 19, 2024
2 parents 8d7a779 + 50c1f09 commit 4206e19
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -60,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- pr-tool: give hint about commit headline length limits [PR #1763]
- stored: fix some sd error messages; add additional check during restore; split up always-incremental-consolidate test [PR #1722]
- Generate LICENSE.txt from LICENSE.template [PR #1753]
- Allow cross-building for Windows on newer compiler [PR #1772]

### Removed
- plugins: remove old deprecated postgres plugin [PR #1606]
Expand Down Expand Up @@ -147,4 +148,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[PR #1761]: https://github.com/bareos/bareos/pull/1761
[PR #1762]: https://github.com/bareos/bareos/pull/1762
[PR #1763]: https://github.com/bareos/bareos/pull/1763
[PR #1772]: https://github.com/bareos/bareos/pull/1772
[unreleased]: https://github.com/bareos/bareos/tree/master
6 changes: 3 additions & 3 deletions core/src/stored/backends/win32_tape_device.cc
Expand Up @@ -1039,11 +1039,11 @@ static DWORD GetDensityBlockSize(HANDLE hDevice,
dwBufferSize += 6 * sizeof(DEVICE_MEDIA_INFO);
GET_MEDIA_TYPES* pNewBuffer
= (GET_MEDIA_TYPES*)realloc(pGetMediaTypes, dwBufferSize);
if (pNewBuffer != pGetMediaTypes) {
if (pNewBuffer == NULL) {
free(pGetMediaTypes);

if (pNewBuffer == NULL) { return ERROR_OUTOFMEMORY; }

return ERROR_OUTOFMEMORY;
} else {
pGetMediaTypes = pNewBuffer;
}
}
Expand Down
14 changes: 5 additions & 9 deletions core/src/win32/compat/include/compat.h
Expand Up @@ -2,7 +2,7 @@
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2004-2011 Free Software Foundation Europe e.V.
Copyright (C) 2019-2023 Bareos GmbH & Co. KG
Copyright (C) 2019-2024 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -77,10 +77,6 @@
# define GWL_USERDATA GWLP_USERDATA
#endif

#ifndef INT64
# define INT64 long long int
#endif

void sleep(int);

typedef UINT32 key_t;
Expand Down Expand Up @@ -179,11 +175,11 @@ struct stat {
#define S_IRUSR S_IREAD
#define S_IWUSR S_IWRITE
#define S_IXUSR S_IEXEC
#define S_ISREG(x) (((x)&S_IFMT) == S_IFREG)
#define S_ISLNK(x) (((x)&S_IFMT) == S_IFLNK)
#define S_ISDIR(x) (((x)&S_IFMT) == S_IFDIR)
#define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
#define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK)
#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
#define S_ISCHR(x) 0
#define S_ISBLK(x) (((x)&S_IFMT) == S_IFBLK)
#define S_ISBLK(x) (((x) & S_IFMT) == S_IFBLK)
#define S_ISFIFO(x) 0

#define S_IRGRP 000040
Expand Down
6 changes: 3 additions & 3 deletions core/src/win32/filed/vss_generic.cc
Expand Up @@ -85,7 +85,7 @@ class IXMLDOMDocument;
# include "Win2003/vswriter.h"
# include "Win2003/vsbackup.h"

# define VSS_ERROR_OBJECT_ALREADY_EXISTS 0x8004230D
# define VSS_ERROR_OBJECT_ALREADY_EXISTS ((HRESULT)0x8004230D)

# include "vss.h"

Expand Down Expand Up @@ -307,7 +307,7 @@ static inline bool HandleVolumeMountPoint(
snapshoted_volumes);
Dmsg1(200, "%s added to snapshotset \n", pvol.c_str());
snapshot_success = true;
} else if ((unsigned)hr == VSS_ERROR_OBJECT_ALREADY_EXISTS) {
} else if (hr == VSS_ERROR_OBJECT_ALREADY_EXISTS) {
Dmsg1(200, "%s already in snapshotset, skipping.\n", pvol.c_str());
} else {
Dmsg3(
Expand Down Expand Up @@ -866,7 +866,7 @@ bool VSSClientGeneric::CreateSnapshots(const std::vector<std::wstring>& volumes,

// startSnapshotSet
hr = pVssObj->StartSnapshotSet(&uidCurrentSnapshotSet_);
while ((unsigned)hr == VSS_E_SNAPSHOT_SET_IN_PROGRESS) {
while (hr == VSS_E_SNAPSHOT_SET_IN_PROGRESS) {
Bmicrosleep(5, 0);
Jmsg(jcr_, M_INFO, 0, "VSS_E_SNAPSHOT_SET_IN_PROGRESS, retrying ...\n");
hr = pVssObj->StartSnapshotSet(&uidCurrentSnapshotSet_);
Expand Down
4 changes: 2 additions & 2 deletions core/src/win32/plugins/filed/mssqlvdi-fd.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2010 Zilvinas Krapavickas <zkrapavickas@gmail.com>
Copyright (C) 2013-2014 Planets Communications B.V.
Copyright (C) 2013-2023 Bareos GmbH & Co. KG
Copyright (C) 2013-2024 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -42,7 +42,7 @@
#include <initguid.h>
#include <adoid.h>
#include <adoint.h>

#include <stdexcept>

namespace filedaemon {

Expand Down

0 comments on commit 4206e19

Please sign in to comment.