Skip to content

Commit

Permalink
Minor fixes & remove old workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Dec 16, 2023
1 parent f20ec31 commit dd4ce37
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 55 deletions.
1 change: 1 addition & 0 deletions _build/vc/all.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/CppClangTidy/EnableClangTidySupport/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/CppInspection/QuickInfoEnabled/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">SOLUTION</s:String>
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/IdentifierHighlightingEnabled/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue">HINT</s:String>
Expand Down
22 changes: 2 additions & 20 deletions far/cddrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,30 +196,12 @@ static auto capatibilities_from_scsi_configuration(const os::fs::file& Device)
auto Spt = InitSCSIPassThrough();

#if !IS_MICROSOFT_SDK()
// GCC headers incorrectly reserve only one bit for RequestType
struct CDB_FIXED
{
struct
{
UCHAR OperationCode;
UCHAR RequestType : 2;
UCHAR Reserved1 : 6;
UCHAR StartingFeature[2];
UCHAR Reserved2[3];
UCHAR AllocationLength[2];
UCHAR Control;
}
GET_CONFIGURATION;
};
#define CDB CDB_FIXED
// Old GCC headers incorrectly reserve only one bit for RequestType
static_assert(decltype(CDB::GET_CONFIGURATION){.RequestType = 0b11 }.RequestType == 0b11);
#endif

auto& GetConfiguration = edit_as<CDB>(Spt.Cdb).GET_CONFIGURATION;

#if !IS_MICROSOFT_SDK()
#undef CDB
#endif

GetConfiguration.OperationCode = SCSIOP_GET_CONFIGURATION;
GetConfiguration.RequestType = SCSI_GET_CONFIGURATION_REQUEST_TYPE_ONE;
write_value_to_big_endian(GetConfiguration.StartingFeature, FeatureProfileList);
Expand Down
2 changes: 1 addition & 1 deletion far/color_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ static void disable_if_needed(COLORREF const Color, span<DialogItemEx> ColorDlgI
{
ColorDlgItems[Offset + cb::color_active_checkbox].Selected = BSTATE_CHECKED;
}
};
}

static bool pick_color_single(colors::single_color& Color, colors::single_color const BaseColor, std::array<COLORREF, 16>& CustomColors)
{
Expand Down
5 changes: 2 additions & 3 deletions far/common/view/zip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ namespace detail
};
}

// the size_t is a workaround for GCC
template<size_t, typename... args>
template<typename... args>
class [[nodiscard]] zip
{
public:
Expand All @@ -183,6 +182,6 @@ class [[nodiscard]] zip
};

template<typename... args>
zip(args&&... Args) -> zip<sizeof...(args), keep_alive_type<decltype(Args)>...>;
zip(args&&... Args) -> zip<keep_alive_type<decltype(Args)>...>;

#endif // ZIP_HPP_92A80223_8204_4A14_AACC_93D632A39884
50 changes: 24 additions & 26 deletions far/platform.headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,35 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "common/compiler.hpp"

#include "disable_warnings_in_std_begin.hpp"
//----------------------------------------------------------------------------

#ifdef __GNUC__
#if !IS_MICROSOFT_SDK()
#include <w32api.h>
#define _W32API_VER (100*(__W32API_MAJOR_VERSION) + (__W32API_MINOR_VERSION))
#if _W32API_VER < 314

#if (100*(__W32API_MAJOR_VERSION) + (__W32API_MINOR_VERSION)) < 314
#error w32api-3.14 (or higher) required
#endif
#undef WINVER
#undef _WIN32_WINNT

#include <winsdkver.h>

#undef _WIN32_
#undef _WIN32_IE
#define WINVER 0x0603
#define _WIN32_WINNT 0x0603
#define _WIN32_IE 0x0700
#endif // __GNUC__
#undef _WIN32_WINNT
#undef _WIN32_WINDOWS_
#undef NTDDI
#undef WINVER

#define _WIN32_ _WIN32_MAXVER
#define _WIN32_IE _WIN32_IE_MAXVER
#define _WIN32_WINNT _WIN32_WINNT_MAXVER
#define _WIN32_WINDOWS_ _WIN32_WINDOWS_MAXVER
#define NTDDI NTDDI_MAXVER
#define WINVER WINVER_MAXVER

#endif

#define WIN32_NO_STATUS //exclude ntstatus.h macros from winnt.h
#include <windows.h>
Expand Down Expand Up @@ -88,27 +101,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#define _NTSCSI_USER_MODE_

#ifdef _MSC_VER
#if IS_MICROSOFT_SDK()
#include <scsi.h>
#endif // _MSC_VER

#ifdef __GNUC__
#else
#include <ntdef.h>
// Workaround for MinGW, see a66e40
// Their loony headers are unversioned,
// so the only way to make it compatible
// with both old and new is this madness:
#include <netfw.h>
#ifndef __INetFwProduct_FWD_DEFINED__
#define _LBA
#define _MSF
#endif
#include <ddk/scsi.h>
#ifndef __INetFwProduct_FWD_DEFINED__
#undef _MSF
#undef _LBA
#endif
#endif // __GNUC__

#include "platform.sdk.hpp"

Expand Down
8 changes: 4 additions & 4 deletions far/scripts/mkdep.awk
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ BEGIN{
split(ENVIRON["FORCEINCLUDELIST"], force_include, " ")
if (compiler=="gcc")
{
dirsep="/";
out="$(OBJDIR)";
obj="o";
rc="rc.o"
dirsep="/";
}
else
{
out="$(INTDIR)";
dirsep="\\";
out="$(INTDIR)" dirsep;
obj="obj";
rc="res"
dirsep="\\";
}
}
{
Expand All @@ -38,7 +38,7 @@ BEGIN{

if(path_part == "" && (ext == obj || ext == rc))
{
print out dirsep filename "." ext ":";
print out filename "." ext ":";
print " " $0;

if (is_cpp)
Expand Down
2 changes: 1 addition & 1 deletion logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dd4ce37

Please sign in to comment.