mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #6653 from dearblue/mingw
Improve HAL-related components for MinGW
This commit is contained in:
@@ -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>
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user