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

Fix build on NetBSD using native curses #25

Merged
merged 1 commit into from
Apr 23, 2018
Merged

Fix build on NetBSD using native curses #25

merged 1 commit into from
Apr 23, 2018

Conversation

travispaul
Copy link
Contributor

@travispaul travispaul commented Apr 23, 2018

In file included from src/render.h:6:0,
                 from src/render.c:13:
src/pipe.h:32:5: error: 'UP' redeclared as different kind of symbol
     UP = 3
     ^
In file included from /usr/include/term.h:2002:0,
                 from src/render.c:11:
/usr/include/termcap.h:45:14: note: previous declaration of 'UP' was here
 extern char *UP;
              ^
*** Error code 1

When building with NetBSD's native curses library an included header: termcap.h already has an extern symbol named "UP" which conflicts with the "DIRECTIONS" enum.

@travispaul
Copy link
Contributor Author

travispaul commented Apr 23, 2018

Looks like moving the enum breaks the tests in t/locale.c...

Would you have any suggestions or preference for avoiding this conflict?

  • Rename the enum members?
  • Redefine the enum again in locale.c?

Neither of those sound like great solutions.

Thanks

@StefansM
Copy link
Contributor

Hi @travispaul,

Thanks for testing on netbsd. I'm interested to see what else ends up breaking, as some of the code is probably quite ncurses-specific.

I'd like to keep the DIRECTIONS enum in the header so that it can be used in the test programs. How about adding a CPIPES_ prefix to each member as a rudimentary namespace?

When building with NetBSD's native curses library the included
header "termcap.h" already has an extern symbol named "UP".
@travispaul
Copy link
Contributor Author

travispaul commented Apr 23, 2018

Hi @StefansM,

That works for me, I'll do some further testing this week and report anything I find but so far it works in ascii mode. I have also been able to trigger a segfault with the wrong TERM set but that seems like it may be an issue with NetBSD curses not cpipes.

@StefansM StefansM merged commit f844cd6 into pipeseroni:master Apr 23, 2018
@StefansM
Copy link
Contributor

Excellent, 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.

2 participants