GreycLab/CImg

Compile error in C++ Builder

ville-v opened this issue · 1 comments

Version 3.2.1 does not compile in C++ Builder 10.3.3 because _getpid() does not exist:

    inline void srand(cimg_uint64 *const p_rng) {
#if cimg_OS==1
      *p_rng = cimg::time() + (cimg_uint64)getpid();
#elif cimg_OS==2
      *p_rng = cimg::time() + (cimg_uint64)_getpid();
#endif
    }

Fixed:

    inline void srand(cimg_uint64 *const p_rng) {
#if cimg_OS==1 || defined(__BORLANDC__)
      *p_rng = cimg::time() + (cimg_uint64)getpid();
#elif cimg_OS==2
      *p_rng = cimg::time() + (cimg_uint64)_getpid();
#endif
    }

Fixed, thanks!