ptsname_r undefined reference

Hello, i'm compile MakoServer, error ptsname_r undefined reference
FreeBSD stdlib.h ptsname(), but no function ptsname_r()
What shall I do?



UPD: replaced ptsname_ function r with ptsname no error compile,


but no further work
 
I had a quick look in the offending code:
Code:
#if defined(BSD) || defined(_OSX_)
#define XTABS OXTABS
static int
ptsname_r(int fd, char* b, int bl)
{
   char* z398210871831554303228849511=ptsname(fd);
   if(z398210871831554303228849511 && strlen(z398210871831554303228849511) < bl)
   {
      strcpy(b,z398210871831554303228849511);
      return 0;
   }
   return -1;
}
#endif

So define BSD (-DBSD) on the command line.

FYI:
You can grep the pre-processor defines for gcc like so:
gcc -dM -E - < /dev/null

Or clang:
clang -dM -E - < /dev/null

There's even a URL for some (not sure how up to date?):

PS. I would have thought BSD was defined, it was years ago. :oops:
 
Back
Top