Chlumsky / msdfgen

Multi-channel signed distance field generator
MIT License
3.9k stars 404 forks source link

Update edge-coloring.cpp - added include <cstdlib>, since we use 'qsort()' func from it #187

Closed inobelar closed 12 months ago

inobelar commented 12 months ago

Greetings!

During compilation of current 'master' branch with (pretty old, huh) gcc (Debian 4.9.2-10) 4.9.2 compiler produced the next error:

/msdfgen-master/core/edge-coloring.cpp: In function ‘void msdfgen::edgeColoringByDistance(msdfgen::Shape&, double, long long unsigned int)’:
/msdfgen-master/core/edge-coloring.cpp:469:103: error: ‘qsort’ was not declared in this scope
         qsort(&graphEdgeDistances[0], graphEdgeDistances.size(), sizeof(const double *), &cmpDoublePtr);
                                                                                                       ^

cppreference say, that qsort() declared in <cstdlib>. After adding that include, the whole library compiled successfuly - no other places to fix :)

This PR fixes this error above :)

Chlumsky commented 12 months ago

Thank you, I found some more instances of qsort with this issue.