bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling ncurses 5.2 on Solaris 8 64-Bit


From: Sullivan N. Beck
Subject: Compiling ncurses 5.2 on Solaris 8 64-Bit
Date: Fri, 30 Nov 2001 17:59:07 -0500

Note: please send any feedback to me (as well as to the mailing list) since
I am not subscribed to the list.

Out of the box, ncurses 5.2 doesn't compile correctly using the SUNWspro
compilers in 64-bit mode.  With a couple minor changes to the source code,
I have fixed it so that the library (with the C++ bindings) compiled.

OS:
   Solaris 8 (with most of the recent patches)
   SUNWspro Sun WorkShop 6 update 1 C++ 5.2

Compiled with:
   CC=cc -xO4 -xarch=v9a
   CXX=CC -xO4 -xarch=v9a

ncurses:
   5.2 with all patches up to 20011124

The first problem is that ncurses/base/vsscanf.c doesn't compile since
you can't access FILE data structure components directly when compiling
64 bit.  See the URL:

http://docs.sun.com/ab2/coll.45.10/SOL64TRANS/@Ab2PageView/3725

for more information.  The sscanf function is available however, and does
the same thing that vsscanf is doing, so it is trivial to fix this problem
with the following patch:

*** ncurses/base/vsscanf.c      Fri Nov 30 17:12:29 2001
--- ncurses/base/vsscanf.c      Fri Nov 30 17:13:26 2001
***************
*** 42,47 ****
--- 42,50 ----
  (const char *str, const char *format, va_list ap)
  {
  #if defined(_IOREAD) && defined(_NFILE)
+ #if HAVE_SSCANF
+     return sscanf(str, format, ap);
+ #else
      /*
       * This code should work on anything descended from AT&T SVr1.
       */
***************
*** 56,61 ****
--- 59,65 ----
      return (vfscanf(&strbuf, format, ap));
  #else
      return (_doscan(&strbuf, format, ap));
+ #endif
  #endif
  #else
      /*
*** configure   Fri Nov 30 17:11:44 2001
--- configure   Fri Nov 30 17:11:46 2001
***************
*** 5792,5797 ****
--- 5792,5798 ----
  vfscanf \
  vsnprintf \
  vsscanf \
+ sscanf \
  
  do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6



The second problem is that genericerror is not defined in libC for the
new c++ compilers.  A patch for this is:

*** c++/etip.h.in       Fri Nov 30 17:16:37 2001
--- c++/etip.h.in       Fri Nov 30 17:17:45 2001
***************
*** 278,284 ****
--- 278,288 ----
        throw *e;
  #endif
  #elif defined(__SUNPRO_CC)
+ #  if (__SUNPRO_CC_COMPAT >= 5)
+   throw *e;
+ #else
    genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
+ #endif
  #else
    if (e)
      cerr << e->message << endl;






--------------------------|  Sullivan Beck  |---------------------------
mailto:address@hidden          |            Senior System Programmer
http://www.cise.ufl.edu/~sbeck     |               University of Florida
PH : (352) 392-1057                |                     CISE Department
Fax: (352) 392-1220                |                            CSE 314E
                                   |         Gainesville, FL  32611-6120
------------------------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]