python / cpython

The Python programming language
https://www.python.org/
Other
60.24k stars 29.15k forks source link

Fix has_key in _cursesmodule.c for linking on Tru64 Unix #32647

Closed 0e8ea242-de97-4e2f-91ce-0e90eec4eba5 closed 23 years ago

0e8ea242-de97-4e2f-91ce-0e90eec4eba5 commented 23 years ago
BPO 400963
Nosy @akuchling
Files
  • None: None
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = 'https://github.com/akuchling' closed_at = created_at = labels = [] title = 'Fix has_key in _cursesmodule.c for linking on Tru64 Unix' updated_at = user = 'https://bugs.python.org/mfavas' ``` bugs.python.org fields: ```python activity = actor = 'akuchling' assignee = 'akuchling' closed = True closed_date = None closer = None components = ['None'] creation = creator = 'mfavas' dependencies = [] files = ['2653'] hgrepos = [] issue_num = 400963 keywords = ['patch'] message_count = 6.0 messages = ['33511', '33512', '33513', '33514', '33515', '33516'] nosy_count = 3.0 nosy_names = ['moshez', 'akuchling', 'mfavas'] pr_nums = [] priority = 'normal' resolution = None stage = None status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue400963' versions = [] ```

    0e8ea242-de97-4e2f-91ce-0e90eec4eba5 commented 23 years ago
    akuchling commented 23 years ago

    I think has_key's existence should be made conditional on the STRICT_SYSV_CURSES macro, not on HAS_HAS_KEY. The way of checking for curses functions individually will only lead to madness, I think. Does this patch still fix the problem?

    akuchling commented 23 years ago

    Applied, with Mark's correction to the revised patch.

    1fb001b0-327a-48b2-868c-8ccd3dcdb0f5 commented 23 years ago

    It seems that this patch is for linking with vanilla curses, not ncurses. Can the person who wrote the patch assure me that it is required to build against ncurses on Tru64?

    0e8ea242-de97-4e2f-91ce-0e90eec4eba5 commented 23 years ago

    On Tru64 Unix, Version 4.0F, it is only possible to link against libcurses - there is no ncurses library. The vendor-sup;plied curses library has no has_key() function. Note that the macro _XOPEN_SOURCEEXTENDED is defined in _cursesmodule.c for \_osf__ to provide the APIs for version 4 of the X/Open Curses ACE spec and there is also no prototype for has_key() in the header file.

    0e8ea242-de97-4e2f-91ce-0e90eec4eba5 commented 23 years ago
    Yes, the revised patch looks fine, apart from the missing bit...
    The #if !defined at line 2114 needs to be changed from
    #if !defined(__sgi__) && !defined(__sun__)
      {"has_key",             (PyCFunction)PyCurses_has_key},
    to
    #ifndef STRICT_SYSV_CURSES
      {"has_key",             (PyCFunction)PyCurses_has_key},