Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Dec 2018 17:10:19 -0500
From:      "James B. Byrne" <byrnejb@harte-lyne.ca>
To:        freebsd-questions@freebsd.org
Subject:   clang FreeBSD question
Message-ID:  <4c729c3af0c550644f1e3b32cbd7f2f9.squirrel@webmail.harte-lyne.ca>

Next in thread | Raw E-Mail | Index | Archive | Help
I am hacking an old terminal emulator program originally written for
something other than FreeBSD. Ihave encountered this error:

cc -I../ -I../BSDI -I/usr/include -I/usr/local/include  
-DSHOW_DC1_COUNT=0 -DDEBUG_BREAK=0 -DIGNORE_KEYBOARD_LOCK=1
-DIGNORE_USER_SYSTEM_LOCK=1 -DDEBUG_BLOCK_MODE=0 -DMEMLOCK_2000 -c
tty.c
tty.c:179:28: error: use of undeclared identifier 'CBAUD'
  curr_termio.c_cflag &= ~(CBAUD);


The code in question looks like this:

#ifdef _POSIX_SOURCE
  if (cfsetispeed((PTERMIO)&curr_termio, speed) == -1)
    {
      printf ("Error %d from cfsetispeed(%s)\n", errno, deviceinfo);
      show_tty_error ("cfsetispeed()", errno);
      return(-1);
    }
  if (cfsetospeed((PTERMIO)&curr_termio, speed) == -1)
    {
      printf ("Error %d from cfsetospeed(%s)\n", errno, deviceinfo);
      show_tty_error ("cfsetospeed()", errno);
      return(-1);
    }
#else
  curr_termio.c_cflag &= ~(CBAUD);
  curr_termio.c_cflag |= speed;

I can guess that FreeBSD is not a POSIX compliant OS, or at least does
not declar itself so in the manner the programmer expected.  However,
the only other references to CBAUD that I can find on this system is:

/usr/local/include/gphoto2/gphoto2-port-portability.h:99:#   define
CBAUD   0x0000100f
/usr/local/include/gphoto2/gphoto2-port-portability.h:129:#   define
CBAUDEX 0x00001000

Soooo.  The question is: Do I just define CBAUD by copy and paste into
a header file and add that to the complier includes?  Or is their a
more informed and elegant answer to my problem?



-- 
***          e-Mail is NOT a SECURE channel          ***
        Do NOT transmit sensitive data via e-Mail
 Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne                mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?4c729c3af0c550644f1e3b32cbd7f2f9.squirrel>