scipy: emulate missing C99 functions in C