Skip to content

Commit 6f4b3b1

Browse files
author
Stephen von Takach
committed
restore windows support
fixes #58
1 parent afc7e08 commit 6f4b3b1

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
3.0.1
2+
-----
3+
4+
Fixed:
5+
6+
* Windows support was broken in 3.0.0
7+
8+
19
3.0.0
210
-----
311

Rakefile

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ namespace "ffi-compiler" do
2929
t.cflags << "-D_GNU_SOURCE=1" if RbConfig::CONFIG["host_os"].downcase =~ /mingw/
3030
t.cflags << "-arch x86_64 -arch i386" if t.platform.mac?
3131
t.ldflags << "-arch x86_64 -arch i386" if t.platform.mac?
32+
33+
t.add_define 'WINDOWS_OS' if FFI::Platform.windows?
3234
end
3335
end
3436
task :compile_ffi => ["ffi-compiler:default"]

ext/scrypt/Rakefile

+2
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ FFI::Compiler::CompileTask.new('scrypt_ext') do |t|
77
t.cflags << "-arch x86_64 -arch i386" if t.platform.mac?
88
t.ldflags << "-arch x86_64 -arch i386" if t.platform.mac?
99
t.export '../../lib/scrypt/scrypt_ext.rb'
10+
11+
t.add_define 'WINDOWS_OS' if FFI::Platform.windows?
1012
end

ext/scrypt/crypto_scrypt.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@
2929
/* #include "bsdtar_platform.h" */
3030

3131
#include <sys/types.h>
32-
#include <sys/mman.h>
33-
32+
#if !defined(WINDOWS_OS)
33+
#include <sys/mman.h>
34+
#ifndef HAVE_MMAP
35+
#define HAVE_MMAP 1
36+
#endif
37+
#endif
3438
#include <errno.h>
3539
#include <stdint.h>
3640
#include <stdlib.h>

lib/scrypt/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module SCrypt
2-
VERSION = "3.0.0"
2+
VERSION = "3.0.1"
33
end

scrypt.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
1919
alternative functions such as PBKDF2 or bcrypt.
2020
EOF
2121

22-
s.add_dependency 'ffi-compiler', '>= 0.0.2'
22+
s.add_dependency 'ffi-compiler', '>= 1.0.0'
2323
s.add_dependency 'rake'
2424
s.add_development_dependency "rspec"
2525
s.add_development_dependency "rdoc"

0 commit comments

Comments
 (0)