xot 0.2.1 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3699d7ae604c3bc0d96a0ebacf3c3a22115e1ba338c9178ebaaf064ad93ca282
4
- data.tar.gz: 810dc619b0d9bf7c0bae8ab97118a3f6170bd864b9872c0efbbce0973a4ea8e1
3
+ metadata.gz: 7d11136d38c0cd9cd9dcca16148115795071e958e05ef3d5b307bd385905c1f6
4
+ data.tar.gz: 7af44d2bcd37badd34c4d5493bc21c5357fcde972b89d9a1833b1e70f5fe12d7
5
5
  SHA512:
6
- metadata.gz: 6fc79411d29fe6a9a26c08e6aeb0979db6a8806c4c1a1361028f0aa402a30612ffa3ca1483bb7b78ae007e9b4d6f7a92139d95dcc57b9e5e290df1a93762c34e
7
- data.tar.gz: 261e370e9c80c9606c44bfd621677381f3c528d9387419c418a18a54ec5dbb53ecf43ce16f3b5f027010ea6e4f39974abf42ddd535d13a40ffc7d4a1e8f8653d
6
+ metadata.gz: ca6c659c661dd12179e968b8a832951cb6a812e0f4155ebb29d807147cae2ba6960c51d823f68a47bc070db4a8070441ba22285f67975686ee31928fa1e8cb90
7
+ data.tar.gz: 9c640bcc810ff7c6143f63936f753bb544f0b939f1c15c4e685b420e614db7e8d8bdcf9b0d105089b727585d9712991dcd0a4f8fd3d183994ae368c1e66ea569
@@ -24,7 +24,7 @@ jobs:
24
24
  run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
25
25
 
26
26
  - name: test
27
- run: bundle exec rake quiet test
27
+ run: bundle exec rake quiet packages test
28
28
 
29
29
  - name: create gem
30
30
  id: gem
@@ -24,6 +24,9 @@ jobs:
24
24
  - name: setup dependencies
25
25
  run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
26
26
 
27
+ - name: packages
28
+ run: bundle exec rake packages
29
+
27
30
  - name: lib
28
31
  run: bundle exec rake lib
29
32
 
data/ChangeLog.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # xot ChangeLog
2
2
 
3
3
 
4
+ ## [v0.3] - 2024-07-06
5
+
6
+ - Support Windows
7
+
8
+
4
9
  ## [v0.2.1] - 2024-07-05
5
10
 
6
11
  - Add xot/util.rb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3
@@ -0,0 +1,15 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __XOT_WINDOWS_H__
4
+ #define __XOT_WINDOWS_H__
5
+
6
+
7
+ #ifdef WIN32
8
+ #undef _WIN32_WINNT
9
+ #define _WIN32_WINNT _WIN32_WINNT_WIN7
10
+ #include <windows.h>
11
+ #include <windowsx.h>
12
+ #endif
13
+
14
+
15
+ #endif//EOH
data/include/xot.h CHANGED
@@ -15,5 +15,7 @@
15
15
  #include <xot/noncopyable.h>
16
16
  #include <xot/util.h>
17
17
 
18
+ //#include <xot/windows.h>
19
+
18
20
 
19
21
  #endif//EOH
data/lib/xot/extconf.rb CHANGED
@@ -29,8 +29,8 @@ module Xot
29
29
 
30
30
  extensions.each do |ext|
31
31
  name = ext.name.downcase
32
- headers << "#{name}.h"
33
- libs << name
32
+ headers << "#{name}.h"
33
+ local_libs << name
34
34
  end
35
35
 
36
36
  ldflags = $LDFLAGS.dup
@@ -45,7 +45,7 @@ module Xot
45
45
  $CFLAGS = make_cflags $CFLAGS + ' -x c++'
46
46
  $CXXFLAGS = make_cflags $CXXFLAGS + ' -x c++' if $CXXFLAGS
47
47
  $LDFLAGS = make_ldflags ldflags, lib_dirs, frameworks
48
- $LOCAL_LIBS << local_libs.map {|s| " -l#{s}"}.join
48
+ $LOCAL_LIBS << local_libs.reverse.map {|s| " -l#{s}"}.join
49
49
  end
50
50
 
51
51
  def create_makefile(*args)
data/lib/xot/rake/util.rb CHANGED
@@ -55,7 +55,10 @@ module Xot
55
55
  end
56
56
 
57
57
  def inc_dirs()
58
- env_array(:INCDIRS, []) + extensions.reverse.map {|m| m.inc_dir}.flatten
58
+ dirs = env_array :INCDIRS, []
59
+ dirs += extensions.reverse.map {|m| m.inc_dir}.flatten
60
+ dirs << "#{env :MINGW_PREFIX}/include" if mingw?
61
+ dirs
59
62
  end
60
63
 
61
64
  def src_dirs()
@@ -170,11 +173,15 @@ module Xot
170
173
 
171
174
  def make_cppflags_defs(defs = [])
172
175
  a = defs.dup
173
- a << $~[0].upcase if RUBY_PLATFORM =~ /mswin|ming|cygwin|darwin/i
174
176
  a << (debug? ? '_DEBUG' : 'NDEBUG')
175
- a << 'WIN32' if win32?
176
- a << 'OSX' if osx?
177
- a << 'IOS' if ios?
177
+ a << target.name.upcase
178
+ a << $~[0].upcase if RUBY_PLATFORM =~ /mswin|mingw|cygwin|darwin/i
179
+ a << 'WIN32' if win32?
180
+ a << 'OSX' if osx?
181
+ a << 'IOS' if ios?
182
+ a << 'GCC' if gcc?
183
+ a << 'CLANG' if clang?
184
+ a << '_USE_MATH_DEFINES' if gcc?
178
185
  a
179
186
  end
180
187
 
@@ -192,11 +199,11 @@ module Xot
192
199
  end
193
200
 
194
201
  def make_cflags(flags = '')
195
- warning_opts = %w[
196
- no-unknown-pragmas
202
+ warning_opts = %w[no-unknown-pragmas]
203
+ warning_opts += %w[
197
204
  no-deprecated-register
198
205
  no-reserved-user-defined-literal
199
- ]
206
+ ] if clang?
200
207
  s = flags.dup
201
208
  s << warning_opts.map {|s| " -W#{s}"}.join
202
209
  s << " -arch arm64" if RUBY_PLATFORM =~ /arm64-darwin/
data/lib/xot/rake.rb CHANGED
@@ -276,7 +276,7 @@ module Xot
276
276
  desc "install packages"
277
277
  task :packages do
278
278
  case
279
- when osx? && osx.size > 0
279
+ when osx? && osx.size > 0
280
280
  sh %( brew install #{osx.join ' '} )
281
281
  when win32? && win32.size > 0
282
282
  prefix = 'MINGW_PACKAGE_PREFIX'
@@ -359,6 +359,9 @@ module Xot
359
359
  end
360
360
 
361
361
  def define_placeholder_tasks()
362
+ desc "install all external packages"
363
+ alias_task :packages
364
+
362
365
  desc "setup all external libraries"
363
366
  alias_task :vendor
364
367
 
data/src/exception.cpp CHANGED
@@ -1,9 +1,7 @@
1
1
  #include "xot/exception.h"
2
2
 
3
3
 
4
- #ifdef WIN32
5
- #include <windows.h>
6
- #endif
4
+ #include "xot/windows.h"
7
5
 
8
6
 
9
7
  namespace Xot
data/src/string.cpp CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  #include <stdio.h>
5
+ #include <string.h>
5
6
  #include <algorithm>
6
7
  #include <memory>
7
8
  #include "xot/exception.h"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
@@ -41,6 +41,7 @@ files:
41
41
  - include/xot/string.h
42
42
  - include/xot/time.h
43
43
  - include/xot/util.h
44
+ - include/xot/windows.h
44
45
  - lib/xot.rb
45
46
  - lib/xot/bit_flag.rb
46
47
  - lib/xot/bit_flag_accessor.rb