This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Should _SB_CTYPE_MACROS be defined on HP-UX 10.20


GCC 3.2.1 on HP-UX 10.20:

$ cat test.c
#include <deque>
#include <ctype.h>

int
main (void) {
  char a;
  isspace(a);
}
$ g++ test.c
test.c: In function `int main()':
test.c:7: `_isspace' undeclared (first use this function)
test.c:7: (Each undeclared identifier is reported only once for each function 
   it appears in.)

In <ctype.h>:
#  if defined(_SB_CTYPE_MACROS) && !defined(__lint)
     extern unsigned int *__SB_masks;
...
#    define isspace(__c)        (__alnum = (__c), __alnum == -1 ? 0           \
                                : __SB_masks ? __SB_masks[__alnum] & _ISSPACE \
                                             : _isspace(__alnum))

And, in /usr/local/include/c++/3.2.1/hppa2.0-hp-hpux10.20/bits/os_defines.h:
// Use macro form of ctype functions to ensure __SB_masks is defined.
#define _SB_CTYPE_MACROS 1

However, there is no prototype for _isspace hence the error above.
HP-UX 11.x solves this with the following in <ctype.h>:
       extern int _isspace(int);

So, how do we solve this on 10.20?

-- 
albert chin (china@thewrittenword.com)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]