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

Another attempt at Windows support (less ifdefs) #66

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

Conversation

adsr
Copy link
Contributor

@adsr adsr commented Apr 8, 2024

See #58 for the first attempt.

@sewbacca
Copy link

sewbacca commented May 12, 2024

I tried compiling under msys/ucrt64, but got a compiler error.

Click here to see error message
termbox2 $ make
cc -DTB_IMPL -DTB_LIB_OPTS -std=c99 -Wall -Wextra -pedantic -Wno-unused-result -g -O0 -D_XOPEN_SOURCE -D_DEFAULT_SOURCE  demo/keyboard.c -o demo/keyboard
In file included from demo/keyboard.c:5:
demo/../termbox2.h: In function 'init_term_caps':
demo/../termbox2.h:2162:16: warning: implicit declaration of function 'parse_terminfo_caps' [-Wimplicit-function-declaration]
 2162 |         return parse_terminfo_caps();
      |                ^~~~~~~~~~~~~~~~~~~
demo/../termbox2.h: In function 'tb_deinit':
demo/../termbox2.h:2320:46: warning: ordered comparison of pointer with integer zero [-Wpedantic]
 2320 |     if (global.caps[0] != NULL && global.wfd >= 0) {
      |                                              ^~
demo/../termbox2.h: At top level:
demo/../termbox2.h:2380:12: error: static declaration of 'parse_terminfo_caps' follows non-static declaration
 2380 | static int parse_terminfo_caps(void) {
      |            ^~~~~~~~~~~~~~~~~~~
demo/../termbox2.h:2162:16: note: previous implicit declaration of 'parse_terminfo_caps' with type 'int()'
 2162 |         return parse_terminfo_caps();
      |                ^~~~~~~~~~~~~~~~~~~
demo/../termbox2.h: In function 'tb_compat_win32_wcwidth':
demo/../termbox2.h:3590:44: warning: unused parameter 'c' [-Wunused-parameter]
 3590 | static int tb_compat_win32_wcwidth(wchar_t c) {
      |                                    ~~~~~~~~^
demo/../termbox2.h: In function 'tb_compat_win32_wcswidth':
demo/../termbox2.h:3594:52: warning: unused parameter 's' [-Wunused-parameter]
 3594 | static int tb_compat_win32_wcswidth(const wchar_t *s, size_t n) {
      |                                     ~~~~~~~~~~~~~~~^
demo/../termbox2.h:3594:62: warning: unused parameter 'n' [-Wunused-parameter]
 3594 | static int tb_compat_win32_wcswidth(const wchar_t *s, size_t n) {
      |                                                       ~~~~~~~^
demo/../termbox2.h: In function 'tb_compat_win32_get_fds':
demo/../termbox2.h:3598:41: warning: unused parameter 'ttyfd' [-Wunused-parameter]
 3598 | static int tb_compat_win32_get_fds(int *ttyfd, int *resizefd) {
      |                                    ~~~~~^~~~~
demo/../termbox2.h:3598:53: warning: unused parameter 'resizefd' [-Wunused-parameter]
 3598 | static int tb_compat_win32_get_fds(int *ttyfd, int *resizefd) {
      |                                                ~~~~~^~~~~~~~
demo/../termbox2.h: At top level:
demo/../termbox2.h:3646:12: warning: 'tb_compat_win32_update_term_size_via_esc' defined but not used [-Wunused-function]
 3646 | static int tb_compat_win32_update_term_size_via_esc(void) {
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
demo/../termbox2.h:2380:12: warning: 'parse_terminfo_caps' defined but not used [-Wunused-function]
 2380 | static int parse_terminfo_caps(void) {
      |            ^~~~~~~~~~~~~~~~~~~
make: *** [Makefile:30: demo/keyboard] Fehler 1
Any ideas how to fix this?

@adsr
Copy link
Contributor Author

adsr commented May 12, 2024

Hi @sewbacca thank you for trying this out. I'm not near my Windows machine but I pushed 94b5082 which is completely untested but may fix your issue. I'll try it on my setup soon.

@sewbacca
Copy link

Thanks for your quick response! It does compile now, but I don't have an example to test it against, because I just stumbled accross this library and want to check it out :D

@adsr adsr marked this pull request as draft May 20, 2024 03:32
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.

None yet

2 participants