Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easy install functions.sh but not consoletype, for x86-winnt profiles #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

haubi
Copy link

@haubi haubi commented Mar 27, 2017

No description provided.

headers.h Outdated
#if defined(__GLIBC__)
#if defined(__GLIBC__) || defined(__CYGWIN__)
# define HAVE_UNISTD_H
# define HAVE_SYS_IOCTL_H

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks compilation with musl libc. According to the main code, the include should be conditional on __linux__ instead of __GLIBC__.

headers.h Outdated
# define HAVE_SYS_SYSMACROS_H
# define HAVE_ERROR_H
# define HAVE_TTYNAME

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unistd.h and ttyname should be available on any POSIX system. So it seems that it would make more sense to test for systems without them.

#ifdef HAVE_SYS_SYSMACROS_H
# include <sys/sysmacros.h>
#endif

#if defined(__GNUC_STDC_INLINE__) && (__GNUC_STDC_INLINE__ - 0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with Clang?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No Clang anywhere here: It should "work", but may not inline anything eventually.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grobian AFAIR, you're using Clang: Do you know whether it does accept the #if (__GNUC_STDC_INLINE__ - 0) preprocessor construct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

% echo "#if defined(__GNUC_STDC_INLINE__) && (__GNUC_STDC_INLINE__ - 0)\n#error yes\n#endif" | clang -E -
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 340 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2
<stdin>:2:2: error: yes
#error yes
 ^

1 error generated.

So I guess yes?

headers.h Outdated
#if defined(__GLIBC__)
#if defined(__GLIBC__) || defined(__CYGWIN__)
# define HAVE_UNISTD_H
# define HAVE_SYS_IOCTL_H
# define HAVE_SYS_SYSMACROS_H
# define HAVE_ERROR_H

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a tangential direction: It seems that the <error.h> header isn't used at all.

Although consoletype can be built with MSVC, it is of less use there.
@doughdemon
Copy link

I just wanted to report that now everything works fine with musl. Thanks!

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