All these changes involving i8 versus "no i8" and INT versus int may fix the problem for one compiler/architecture, but are prone to break it in another one. As mgarraha mentioned, the only portable way to do these things is to use Fortran 2003's iso_c_binding module.

Here's my original post he's referring to.