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

pdcurses: header does not match library #31674

Open
GitMensch opened this issue May 28, 2023 · 8 comments
Open

pdcurses: header does not match library #31674

GitMensch opened this issue May 28, 2023 · 8 comments
Assignees
Labels
category:question This issue is a question

Comments

@GitMensch
Copy link
Contributor

Describe the bug
All PDCurses headers but the one from the xcurses port are "static" and not adjusted when installed.

The PDCurses header has:

Define before inclusion (only those needed):

    XCURSES         True if compiling for X11.
    PDC_RGB         True if you want to use RGB color definitions
                    (Red = 1, Green = 2, Blue = 4) instead of BGR.
    PDC_WIDE        True if building wide-character support.
    PDC_DLL_BUILD   True if building a Windows DLL.
    PDC_NCMOUSE     Use the ncurses mouse API instead
                    of PDCurses' traditional mouse API.

but for a port that is highly bad (upstream is to blame), because all but the PDC_NCMOUSE must match the actual build (XCURSES is defined in the generated header for that port), and when just using the port you don't know up-front how this build was done.

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install pdcurses
  2. use a test program to #include <curses.h>, then output PDC_WIDE, PDC_DLL_BUILD, PDC_RGB (all not set) and the flags that PDC_get_version returns (the build has WIDE + UTF8 + DLL flags set).

Expected behavior
inclusion of the header should set the flags that are "inbuilt" and must match the built

Suggestion
Either directly patch the hard-wired three entries in curses.h, or (which would also allow to install both the ncurses and the pdcurses port together) install curses.h into a subfolder "pdcurses" and install a wrapper "pdcurses.h":

#define PDC_DLL_BUILD
#define PDC_WIDE
#define PDC_FORCE_UTF8
#include <pdcurses/curses.h>

@LilyWangLL Any thoughts?

@LilyWangLL LilyWangLL added the category:port-bug The issue is with a library, which is something the port should already support label May 29, 2023
@LilyWangLL
Copy link
Contributor

Thanks for your issue. I will investigate this issue and fix it.

@LilyWangLL LilyWangLL added category:question This issue is a question and removed category:port-bug The issue is with a library, which is something the port should already support labels Jun 26, 2023
@LilyWangLL
Copy link
Contributor

Sorry for the late reply, I check the codes of pdcurses, not its build has been defined the following macros.

PDC_DLL_BUILD
PDC_WIDE
PDC_FORCE_UTF8

Its build compile the file Makefile.vc, and the following codes defined these macros.

!ifdef WIDE
WIDEOPT		= -DPDC_WIDE
!endif

!ifdef UTF8
UTF8OPT		= -DPDC_FORCE_UTF8
!endif

!ifdef DLL
DLLOPT		= -DPDC_DLL_BUILD
PDCLIBS		= $(CURSESDLL)
!else
PDCLIBS		= $(LIBCURSES)
!endif

@github-actions
Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added the Stale label Jul 25, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2023
@GitMensch
Copy link
Contributor Author

@LilyWangLL this issue is about placing the defines that were used to built into the distributed curses.h (likely a wrapper that includes the real header from a subdirectory). You've found the definitions to use, so do you plan to add that wrapper manually once or have it generated, too?

@LilyWangLL LilyWangLL reopened this Aug 10, 2023
@github-actions github-actions bot removed the Stale label Aug 11, 2023
@github-actions
Copy link

github-actions bot commented Sep 9, 2023

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added Stale and removed Stale labels Sep 9, 2023
@GitMensch
Copy link
Contributor Author

Does the category "question" is really correct? There's an actual TODO behind this issue.

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added Stale and removed Stale labels Oct 8, 2023
Copy link

github-actions bot commented Nov 8, 2023

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

2 participants