Use of undeclared identifier 'errno'

I am trying to install a new version of ruby using rbenv. During compilation, the build fails with the error messages:


cont.c:897:9: error: use of undeclared identifier 'errno'

errno = 0;

^

cont.c:900:80: error: use of undeclared identifier 'errno'

rb_raise(rb_eFiberError, "can't alloc machine stack to fiber: %s", ERRNOMSG);

^

cont.c:862:27: note: expanded from macro 'ERRNOMSG'

#define ERRNOMSG strerror(errno)

^

cont.c:906:68: error: use of undeclared identifier 'errno'

rb_raise(rb_eFiberError, "can't set a guard page: %s", ERRNOMSG);

^

cont.c:862:27: note: expanded from macro 'ERRNOMSG'

#define ERRNOMSG strerror(errno)

^

3 errors generated.

make: *** [cont.o] Error 1

make: *** Waiting for unfinished jobs....

dir.c:562:10: error: use of undeclared identifier 'errno'

int e = errno;

^

dir.c:567:16: error: use of undeclared identifier 'EIO'

else if (e == EIO) {

^

dir.c:788:5: error: use of undeclared identifier 'errno'

errno = 0;

^

dir.c:793:10: error: use of undeclared identifier 'errno'

int e = errno;

^

dir.c:1363:17: error: use of undeclared identifier 'ENOENT'

return e == ENOENT || e == ENOTDIR;

^

dir.c:1363:32: error: use of undeclared identifier 'ENOTDIR'

return e == ENOENT || e == ENOTDIR;

^

dir.c:1401:35: error: use of undeclared identifier 'errno'

if (ret < 0 && !to_be_ignored(errno))

^

dir.c:1416:35: error: use of undeclared identifier 'errno'

if (ret < 0 && !to_be_ignored(errno))

^

dir.c:1463:10: error: use of undeclared identifier 'errno'

int e = errno;

^

dir.c:1516:10: error: use of undeclared identifier 'errno'

int e = errno;

^

dir.c:1804:21: error: use of undeclared identifier 'errno'

if (!to_be_ignored(errno))

^

dir.c:1993:18: error: use of undeclared identifier 'EACCES'

if (error == EACCES) {

^

dir.c:2221:42: error: use of undeclared identifier 'errno'

if ((magical < 2) && !recursive && (errno == EACCES)) {

^

dir.c:2221:51: error: use of undeclared identifier 'EACCES'

if ((magical < 2) && !recursive && (errno == EACCES)) {

^

dir.c:3292:10: error: use of undeclared identifier 'errno'

int e = errno;

^

15 errors generated.

make: *** [dir.o] Error 1


I've searched everywhere for how to fix this issue, with no success.


I also receive the error when trying to install the rails gem. It seems to be a system issue.


Any help resolving this would be appreciated.


macOS Mojave - 10.14.3

Xcode 10.1 with CLI tools installed

I'm sure it is a problem with the ruby source. They aren't including the appropriate header for "errno". Submit a bug report if it isn't already fixed in some version more recent than what you are using.

Use of undeclared identifier 'errno'
 
 
Q