Skip to content

Commit

Permalink
restore windows support
Browse files Browse the repository at this point in the history
fixes #58
  • Loading branch information
Stephen von Takach committed Jul 6, 2016
1 parent afc7e08 commit 6f4b3b1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
3.0.1
-----

Fixed:

* Windows support was broken in 3.0.0


3.0.0
-----

Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ namespace "ffi-compiler" do
t.cflags << "-D_GNU_SOURCE=1" if RbConfig::CONFIG["host_os"].downcase =~ /mingw/
t.cflags << "-arch x86_64 -arch i386" if t.platform.mac?
t.ldflags << "-arch x86_64 -arch i386" if t.platform.mac?

t.add_define 'WINDOWS_OS' if FFI::Platform.windows?
end
end
task :compile_ffi => ["ffi-compiler:default"]
Expand Down
2 changes: 2 additions & 0 deletions ext/scrypt/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ FFI::Compiler::CompileTask.new('scrypt_ext') do |t|
t.cflags << "-arch x86_64 -arch i386" if t.platform.mac?
t.ldflags << "-arch x86_64 -arch i386" if t.platform.mac?
t.export '../../lib/scrypt/scrypt_ext.rb'

t.add_define 'WINDOWS_OS' if FFI::Platform.windows?
end
8 changes: 6 additions & 2 deletions ext/scrypt/crypto_scrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@
/* #include "bsdtar_platform.h" */

#include <sys/types.h>
#include <sys/mman.h>

#if !defined(WINDOWS_OS)
#include <sys/mman.h>
#ifndef HAVE_MMAP
#define HAVE_MMAP 1
#endif
#endif
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/scrypt/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SCrypt
VERSION = "3.0.0"
VERSION = "3.0.1"
end
2 changes: 1 addition & 1 deletion scrypt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
alternative functions such as PBKDF2 or bcrypt.
EOF

s.add_dependency 'ffi-compiler', '>= 0.0.2'
s.add_dependency 'ffi-compiler', '>= 1.0.0'
s.add_dependency 'rake'
s.add_development_dependency "rspec"
s.add_development_dependency "rdoc"
Expand Down

0 comments on commit 6f4b3b1

Please sign in to comment.