Date: Mon, 4 Dec 2018 11:22:13 -0800 From: Karl Young <freebsd@kipshouse.org> To: byrnejb@harte-lyne.ca Cc: freebsd-questions@freebsd.org Subject: Re: clang FreeBSD question Message-ID: <20181203235313.GU21286@mailboy.kipshouse.net> Resent-Message-ID: <20181204192322.GA25082@mailboy.kipshouse.net> In-Reply-To: <4c729c3af0c550644f1e3b32cbd7f2f9.squirrel@webmail.harte-lyne.ca> References: <4c729c3af0c550644f1e3b32cbd7f2f9.squirrel@webmail.harte-lyne.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
This mail never made it to the list. I see I sent it from a different address than I subscribed with. Trying again. FreeBSD should be Posix-compliant. It looks like the _POSIX_SRC macro is obsolete, but you might try defining it. https://www.freebsd.org/cgi/man.cgi?query=feature_test_macros&manpath=SuSE+Linux/i386+11.3 James B. Byrne via freebsd-questions(freebsd-questions@freebsd.org)@2018.12.03 17:10:19 -0500: > 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 > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181203235313.GU21286>