Merge pull request #6653 from dearblue/mingw

Improve HAL-related components for MinGW
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-10-27 10:56:28 +09:00
committed by GitHub
5 changed files with 13 additions and 12 deletions
+5 -4
View File
@@ -7,19 +7,20 @@
** Supported platforms: Windows, MinGW
*/
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 // need Windows XP or later
#endif
#include <mruby.h>
#include <mruby/string.h>
#include <mruby/class.h>
#include <mruby/error.h>
#include <mruby/presym.h>
#include "socket_hal.h"
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#include <errno.h>
#include <string.h>
/*
+2 -2
View File
@@ -11,10 +11,10 @@ MRuby::Gem::Specification.new('mruby-dir') do |spec|
elsif spec.build.primary_toolchain == 'visualcpp'
# Visual C++ on Windows - use native Windows HAL
'hal-win-dir'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-dir'
elsif spec.for_windows?
'hal-win-dir'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-dir'
else
nil
end
+2 -2
View File
@@ -13,10 +13,10 @@ MRuby::Gem::Specification.new('mruby-io') do |spec|
suggested_hal = if spec.build.primary_toolchain == 'visualcpp'
# Visual C++ on Windows - use native Windows HAL
'hal-win-io'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-io'
elsif spec.for_windows?
'hal-win-io'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-io'
else
nil
end
+2 -2
View File
@@ -16,10 +16,10 @@ MRuby::Gem::Specification.new('mruby-socket') do |spec|
suggested_hal = if spec.build.primary_toolchain == 'visualcpp'
# Visual C++ on Windows - use native Windows HAL
'hal-win-socket'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-socket'
elsif spec.for_windows?
'hal-win-socket'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-socket'
else
nil
end
+2 -2
View File
@@ -18,10 +18,10 @@ MRuby::Gem::Specification.new('mruby-task') do |spec|
RUBY_PLATFORM =~ /mingw/
# MinGW provides POSIX I/O but NOT POSIX signals - use Windows HAL
'hal-win-task'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-task'
elsif spec.for_windows?
'hal-win-task'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-task'
else
nil
end