Update port.c

::isnan() and ::isinf() not defined on FreeBSD. Updated lines 517, 533 and 561 to recognize isnan() and isinf() instead.