Skip to content

Commit 1511821

Browse files
committed
Define _GNU_SOURCE while compiling for MUSL
1 parent e01e78a commit 1511821

File tree

5 files changed

+15
-16
lines changed

5 files changed

+15
-16
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ install: true
3434

3535
script:
3636
- npm test
37-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run -it -w /src --entrypoint /bin/sh -v`pwd`:/src "node:${TRAVIS_NODE_VERSION}-alpine" test_alpine.sh; fi;
37+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run -w /src --entrypoint /bin/sh -v`pwd`:/src "node:${TRAVIS_NODE_VERSION}-alpine" test_alpine.sh; fi;
3838

3939

4040
after_success:

binding.gyp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
'src/bcrypt.cc',
88
'src/bcrypt_node.cc'
99
],
10+
'defines': [
11+
'_GNU_SOURCE',
12+
],
1013
'cflags!': [ '-fno-exceptions' ],
1114
'cflags_cc!': [ '-fno-exceptions' ],
1215
'include_dirs' : [

src/bcrypt.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <stdlib.h>
3636
#include <sys/types.h>
3737
#include <string.h>
38+
3839
#include "node_blf.h"
3940

4041
#ifdef _WIN32

src/blowfish.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@
3939
* Bruce Schneier.
4040
*/
4141

42-
#if 0
43-
#include <stdio.h> /* used for debugging */
44-
#include <string.h>
45-
#endif
46-
47-
#include <sys/types.h>
48-
4942
#include "node_blf.h"
5043

5144
#undef inline

src/node_blf.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#ifndef _NODE_BLF_H_
3535
#define _NODE_BLF_H_
3636

37+
#include <sys/types.h>
38+
3739
/* Solaris compatibility */
3840
#ifdef __sun
3941
#define u_int8_t uint8_t
@@ -50,14 +52,14 @@
5052
#endif
5153

5254
/* Windows ssize_t compatibility */
53-
#if defined(_WIN32) || defined(_WIN64)
54-
# if defined(_WIN64)
55-
typedef __int64 LONG_PTR;
56-
# else
57-
typedef long LONG_PTR;
58-
# endif
59-
typedef LONG_PTR SSIZE_T;
60-
typedef SSIZE_T ssize_t;
55+
#if defined(_WIN32) || defined(_WIN64)
56+
# if defined(_WIN64)
57+
typedef __int64 LONG_PTR;
58+
# else
59+
typedef long LONG_PTR;
60+
# endif
61+
typedef LONG_PTR SSIZE_T;
62+
typedef SSIZE_T ssize_t;
6163
#endif
6264

6365
#define BCRYPT_VERSION '2'

0 commit comments

Comments
 (0)