FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix building on FreeBSD 12 by meanphil · Pull Request #232 · bcrypt-ruby/bcrypt-ruby · GitHub

Repository navigation

Fix building on FreeBSD 12 - #232

Closed
meanphil wants to merge 1 commit into
bcrypt-ruby:masterfrom
meanphil:freebsd12_fix
Closed

meanphil wants to merge 1 commit into
bcrypt-ruby:masterfrom
meanphil:freebsd12_fix

Conversation

Copy link
Copy Markdown

Based on a similar previous commit in ow-crypt.h, skip (re)defining crypt_r function signatures when they already exist in unistd.h

Not sure if this is completely the correct fix, but seems to work with FreeBSD and passes specs. Just unsure if it's then broken other platforms...

Without the fix, it has a similar error to building 3.1.12 on FreeBSD 12:

compiling ../../../../ext/mri/wrapper.c
../../../../ext/mri/wrapper.c:182:7: error: conflicting types for 'crypt_r'
char *crypt_r(const char *key, const char *setting, void *data)
      ^
/usr/include/unistd.h:499:7: note: previous declaration is here
char    *crypt_r(const char *, const char *, struct crypt_data *);
         ^
1 error generated.

FreeBSD 12.1
Ruby 2.6.6
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)

Based on a similar commit in ow-crypt.h, skip (re)defining crypt_r function
signatures, when they already exist in unistd.h

meanphil commented Jul 29, 2020 •
edited
Loading

Copy link
Copy Markdown
Author

Actually, it kind of looks like the 'crypt_r' function could be removed entirely as it's never called. Also the name of the GNU flag is misleading, it should really just be a generic test to see if the OS already has a function with the same name, rather than just checking for __GLIBC__

jlduran commented Jul 31, 2020

Copy link
Copy Markdown

Similar to: #166

Copy link
Copy Markdown

In #233 there was a comment by michelboaventura with another possible fix. He said:

I think de last argument's type is wrong. If you look at the documentation for crypt_r it should be struct crypt_data *, not void *. https://linux.die.net/man/3/crypt_r. If you change just this type it compiles both on FreeBSD and Linux.

meanphil closed this Aug 28, 2020
meanphil deleted the freebsd12_fix branch September 2, 2020 21:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL