I need to call a function written in C from a GNU COBOL program which returns a 64 bit integer (BINARY-DOUBLE in COBOL). However, it seems like GNU COBOL assumes that the return value is always BINARY-LONG, which means the return value is messed up.
Of course, the obvious solution would be to "return" the value by passing a reference to where I want the C function to put it, but I can't change the original C function. I could write a wrapper in C, but it seems annoying to do that every time I need call a function with a 64-bit return value, so I'm wondering if there's a way to do this within COBOL.