POV-Ray : Newsgroups : povray.unofficial.patches : Hgpovray38, current state : Re: Hgpovray38, current state Server Time
28 Apr 2024 12:13:56 EDT (-0400)
  Re: Hgpovray38, current state  
From: jr
Date: 2 Jun 2020 14:15:00
Message: <web.5ed696c1b933d8374d00143e0@news.povray.org>
hi,

"Mr" <mauriceraybaud [at] hotmail dot fr>> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> > "Mr" <mauriceraybaud [at] hotmail dot fr>> wrote:
> > > ...
> > > > > 8>..\..\source\parser\parser.cpp(12022): error C2065: 'ssize_t' :
> > > ...
> > > > you can fix the ssize_t error by defining it as a signed integer such as
> > > > int_least32_t
> > >
> > > I don't know if that was any sensible thing to do but, in parser.cpp, line 12022
> > > and 12023 I made a few attempts at replacing "ssize_t"
> > >
> > > ssize_t idx1 = std::min(Local_Vector[0], Local_Vector[1]);
> > > ssize_t idx2 = std::max(Local_Vector[0], Local_Vector[1]);
> > >
> > > First by "int_least32_t" and then by "unsigned int" and finally "int_least64_t",
> > > but every time only got an  error "conversion de 'size_t' en 'int', perte

> > > processor machine.
> > >
> > > Any further advice?
> >
> > taking that error (from clean source, I assume) means that, for some reason, no
> > header is included which provides 'ssize_t'.  after a quick look on my system, I
> > think including 'unistd.h' would do.  alternatively, you could, at the top of
> > whichever .cpp file, add a definition (ideally with a '#ifndef' guard) like:
> >   #define ssize_t int
> >
> > POSIX guarantees a max of 32767, I think.

should have written: guarantees at least a maximum of 32767.

> >
> I made a search for "unistd.h" and could not find it neither in HG-POV nor in
> POV-Ray 3.8 sources. what path should I include from? I tried without path and
> it is not found.


it's not part of an application, it's a system header (well, it is here, on a
Slackware GNU/Linux box).  turns out on my box just including 'stdio.h' is
enough.

jr@crow:1:tmp$ locate unistd.h | grep /usr/include
/usr/include/unistd.h
/usr/include/sys/unistd.h
/usr/include/asm-x86/unistd.h
/usr/include/bits/unistd.h
/usr/include/linux/unistd.h
/usr/include/asm-generic/unistd.h
jr@crow:2:tmp$ cat mr.c
#include <stdio.h>

int main(void) {
  ssize_t a, b, c;
  a = -1, b = 0, c = 1;
  printf("ssize_t vals: %zd  %zd  %zd\n", a, b, c);
  return 0;
}

jr@crow:3:tmp$ c99 mr.c
jr@crow:4:tmp$ ./a.out
ssize_t vals: -1  0  1
jr@crow:5:tmp$


(the 'c99' is a shell alias for the compiler)


regards, jr.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.