lharding / tasknc

ncurses wrapper around taskwarrior
MIT License
117 stars 18 forks source link

Can't compile on Cygwin windows #13

Open duckpuppy opened 12 years ago

duckpuppy commented 12 years ago

In the ncurses_init method in tasknc.c, there's an attempt to assign to stdscr:

if ((stdscr = initscr()) == NULL )

This won't work, as stdscr is #defined to a function in the current ncurses implementation in Cygwin, which is not a valid lvalue (and the resulting error is a complaint that the left side of an assignment is not an lvalue).

mjheagle8 commented 12 years ago

Hi, At the moment, I cannot test in cygwin. Hopefully I will be able to soon. Would you be able to create a patch that would fix this? Thanks for trying tasknc! -mjheagle On Nov 6, 2012 3:36 PM, "Patrick Aikens" notifications@github.com wrote:

In the ncurses_init method in tasknc.c, there's an attempt to assign to stdscr:

if ((stdscr = initscr()) == NULL )

This won't work, as stdscr is #defined to a function in the current ncurses implementation in Cygwin, which is not a valid lvalue (and the resulting error is a complaint that the left side of an assignment is not an lvalue).

— Reply to this email directly or view it on GitHubhttps://github.com/mjheagle8/tasknc/issues/13.

realchrisolin commented 11 years ago

I was able to fix this in Cygwin by simply changing the variable name and declaring it. I want to test these changes on my laptop running Arch Linux first before submitting a patch (I want to make sure this doesn't unintentionally break something else on a non-Cygwin system, but I doubt it will).

In the meantime, git diff between my local branch and the remote branch is below:

diff --git a/src/tasknc.c b/src/tasknc.c
index d0c83bd..0f1479b 100644
--- a/src/tasknc.c
+++ b/src/tasknc.c
@@ -590,8 +590,8 @@ void ncurses_init() /* {{{ */

        /* initialize screen */
        tnc_fprintf(stdout, LOG_DEBUG, "starting ncurses...");
-       stdscr = initscr();
-       if (stdscr == NULL )
+       int stdscrn = initscr();
+       if (stdscrn == NULL )
        {
            fprintf(stderr, "Error initialising ncurses.\n");
            exit(EXIT_FAILURE);
realchrisolin commented 11 years ago

I take this back. It will compile successfully, but the program itself isn't working. It keeps 'ending abnormally'. I think this is happening somewhere in configure().

I'll try to keep working on this and if I can fix it, I'll submit a patch.

lharding commented 9 years ago

With mjheagle8's blessing, I'm taking over maintenance of this project. If you still care about this issue, please reopen it over at my fork.