[Bug 261829] lang/expect: fix build with only lang/tcl87 installed

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 09 Feb 2022 13:27:25 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261829

            Bug ID: 261829
           Summary: lang/expect: fix build with only lang/tcl87 installed
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: tcltk@FreeBSD.org
          Reporter: dim@FreeBSD.org
          Assignee: tcltk@FreeBSD.org
             Flags: maintainer-feedback?(tcltk@FreeBSD.org)

Created attachment 231676
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=231676&action=edit
Replace CONST84 with CONST

If you have DEFAULT_VERSIONS+=tcltk=8.7 in your make.conf, and therefore only
have lang/tcl87 installed, lang/expect does not compile, complaining about an
bad identifier "CONST84".

With the older lang/tcl86 installed, this is defined in
/usr/local/include/tcl8.6/tcl.h:

#ifdef USE_NON_CONST
#   ifdef USE_COMPAT_CONST
#      error define at most one of USE_NON_CONST and USE_COMPAT_CONST
#   endif
#   define CONST84
#   define CONST84_RETURN
#else
#   ifdef USE_COMPAT_CONST
#      define CONST84
#      define CONST84_RETURN const
#   else
#      define CONST84 const
#      define CONST84_RETURN const
#   endif
#endif

#ifndef CONST86
#      define CONST86 CONST84
#endif

Since we are now in the next millennium, we can assume const always works, and
replace the CONST84 macro with just CONST.

-- 
You are receiving this mail because:
You are the assignee for the bug.