Skip to content

Commit

Permalink
* It works on Windows 98 baby !
Browse files Browse the repository at this point in the history
  • Loading branch information
iProgramMC committed Feb 1, 2025
1 parent 2ce408c commit 72179ed
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 13 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ MSYS_PATH ?= C:/MinGW/msys/1.0
OPENSSL_INC_DIR ?= C:/crpa/openssl/include
OPENSSL_LIB_DIR ?= C:/crpa/openssl

# Print info
$(info Discord Messenger makefile)
$(info Debug: $(DEBUG))
$(info Unicode: $(UNICODE))

USER_INC_DIRS =
USER_DEFINES =

Expand Down Expand Up @@ -49,7 +54,8 @@ DEFINES = \
-DASIO_IPROGS_THREADS \
-D_WEBSOCKETPP_IPROGS_THREAD_ \
-DMINGW_SPECIFIC_HACKS \
-DASIO_DISABLE_WINDOWS_OBJECT_HANDLE
-DASIO_DISABLE_WINDOWS_OBJECT_HANDLE \
-DASIO_DISABLE_IOCP

ifeq ($(UNICODE), no)
UNICODE_DEF =
Expand Down
8 changes: 4 additions & 4 deletions deps/asio/asio/detail/impl/win_event.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ win_event::win_event()
: state_(0)
{
#if defined(ASIO_WINDOWS_APP)
events_[0] = ::CreateEventExW(0, 0,
events_[0] = ::CreateEventEx(0, 0,
CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
#else // defined(ASIO_WINDOWS_APP)
events_[0] = ::CreateEventW(0, true, false, 0);
events_[0] = ::CreateEvent(0, true, false, 0);
#endif // defined(ASIO_WINDOWS_APP)
if (!events_[0])
{
Expand All @@ -46,9 +46,9 @@ win_event::win_event()
}

#if defined(ASIO_WINDOWS_APP)
events_[1] = ::CreateEventExW(0, 0, 0, EVENT_ALL_ACCESS);
events_[1] = ::CreateEventEx(0, 0, 0, EVENT_ALL_ACCESS);
#else // defined(ASIO_WINDOWS_APP)
events_[1] = ::CreateEventW(0, false, false, 0);
events_[1] = ::CreateEvent(0, false, false, 0);
#endif // defined(ASIO_WINDOWS_APP)
if (!events_[1])
{
Expand Down
6 changes: 4 additions & 2 deletions deps/asio/asio/detail/impl/win_mutex.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ int win_mutex::do_init()
return ::GetLastError();
# else
if (!::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000))
return ::GetLastError();
// just initialize it normally
::InitializeCriticalSection(&crit_section_);
# endif
return 0;
#else
Expand All @@ -61,7 +62,8 @@ int win_mutex::do_init()
return ::GetLastError();
# else
if (!::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000))
return ::GetLastError();
// just initialize it normally
::InitializeCriticalSection(&crit_section_);
# endif
}
__except(GetExceptionCode() == STATUS_NO_MEMORY
Expand Down
6 changes: 6 additions & 0 deletions vs/DiscordMessenger.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Global
DebugAnsi|x86 = DebugAnsi|x86
DebugAsan|x64 = DebugAsan|x64
DebugAsan|x86 = DebugAsan|x86
DebugNoIOCP|x64 = DebugNoIOCP|x64
DebugNoIOCP|x86 = DebugNoIOCP|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
ReleaseAnsi|x64 = ReleaseAnsi|x64
Expand All @@ -31,6 +33,10 @@ Global
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.DebugAsan|x64.Build.0 = DebugAsan|x64
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.DebugAsan|x86.ActiveCfg = DebugAsan|Win32
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.DebugAsan|x86.Build.0 = DebugAsan|Win32
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.DebugNoIOCP|x64.ActiveCfg = DebugNoIOCP|x64
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.DebugNoIOCP|x64.Build.0 = DebugNoIOCP|x64
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.DebugNoIOCP|x86.ActiveCfg = DebugNoIOCP|Win32
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.DebugNoIOCP|x86.Build.0 = DebugNoIOCP|Win32
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.Release|x64.ActiveCfg = Release|x64
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.Release|x64.Build.0 = Release|x64
{3249EAC3-35D9-4646-ACE2-E2BD3B7F4812}.Release|x86.ActiveCfg = Release|Win32
Expand Down
63 changes: 62 additions & 1 deletion vs/DiscordMessenger.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
<Configuration>DebugAsan</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugNoIOCP|Win32">
<Configuration>DebugNoIOCP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugNoIOCP|x64">
<Configuration>DebugNoIOCP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -57,6 +65,12 @@
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugNoIOCP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAnsi|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down Expand Up @@ -90,6 +104,12 @@
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugNoIOCP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAnsi|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down Expand Up @@ -124,6 +144,9 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugNoIOCP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAnsi|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand All @@ -139,6 +162,9 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugNoIOCP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAnsi|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand All @@ -157,6 +183,11 @@
<GenerateManifest>false</GenerateManifest>
<IntDir>obj\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugNoIOCP|Win32'">
<OutDir>$(SolutionDir)..\bin\$(Configuration)\</OutDir>
<GenerateManifest>false</GenerateManifest>
<IntDir>obj\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAnsi|Win32'">
<OutDir>$(SolutionDir)..\bin\$(Configuration)\</OutDir>
<GenerateManifest>false</GenerateManifest>
Expand Down Expand Up @@ -195,6 +226,24 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNoIOCP|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>ASIO_DISABLE_IOCP;USE_IPROGRAMS_TERMINATE;ASIO_DISABLE_WINDOWS_OBJECT_HANDLE;_WIN32_WINNT=0x0601;NOMINMAX;_CRT_SECURE_NO_WARNINGS;ASIO_SEPARATE_COMPILATION;ASIO_STANDALONE;_WEBSOCKETPP_CPP11_STL_;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)..\deps;$(SolutionDir)..\deps\asio;$(SolutionDir)..\deps\mwas\include;$(OPENSSL_INSTALL)\include</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessToFile>false</PreprocessToFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\libs;$(OPENSSL_INSTALL)\lib;$(OPENSSL_INSTALL);</AdditionalLibraryDirectories>
<AdditionalDependencies>libwebp.lib;libcrypto.lib;libssl.lib;ws2_32.lib;msimg32.lib;shlwapi.lib;comctl32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAnsi|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand Down Expand Up @@ -285,6 +334,18 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNoIOCP|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAnsi|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand Down Expand Up @@ -466,6 +527,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\deps\httplib\httplib.h" />
<ClInclude Include="..\deps\iprogramsterminate.h" />
<ClInclude Include="..\src\discord\ActiveStatus.hpp" />
<ClInclude Include="..\src\discord\Attachment.hpp" />
<ClInclude Include="..\src\discord\Channel.hpp" />
Expand Down Expand Up @@ -499,7 +561,6 @@
<ClInclude Include="..\src\discord\UserGuildSettings.hpp" />
<ClInclude Include="..\src\discord\Util.hpp" />
<ClInclude Include="..\src\discord\WebsocketClient.hpp" />
<ClInclude Include="..\src\iprogramsterminate.h" />
<ClInclude Include="..\src\resource.h" />
<ClInclude Include="..\src\windows\AboutDialog.hpp" />
<ClInclude Include="..\src\windows\AutoComplete.hpp" />
Expand Down
10 changes: 5 additions & 5 deletions vs/DiscordMessenger.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,6 @@
<ClInclude Include="..\src\windows\ShellNotification.hpp">
<Filter>Header Files\Windows</Filter>
</ClInclude>
<ClInclude Include="..\src\windows\NotificationViewer.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\discord\DiscordClientConfig.hpp">
<Filter>Header Files\Discord</Filter>
</ClInclude>
Expand All @@ -635,8 +632,11 @@
<ClInclude Include="..\src\discord\MessagePoll.hpp">
<Filter>Header Files\Discord</Filter>
</ClInclude>
<ClInclude Include="..\src\iprogramsterminate.h">
<Filter>Header Files</Filter>
<ClInclude Include="..\src\windows\NotificationViewer.hpp">
<Filter>Header Files\Windows</Filter>
</ClInclude>
<ClInclude Include="..\deps\iprogramsterminate.h">
<Filter>Source Files\Deps</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 72179ed

Please sign in to comment.