GreycLab / CImg

The CImg Library is a small and open-source C++ toolkit for image processing
http://cimg.eu
Other
1.48k stars 282 forks source link

Compile error in C++ Builder #374

Closed ville-v closed 1 year ago

ville-v commented 1 year ago

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
    }
dtschump commented 1 year ago

Fixed, thanks!