define PATH_MAX and add a cast

try without extern C