[PATCH] libogg's os_types.h / config_types.h have limited portability (Mac OS X)
The following issue affects at least libogg 1.2.2 up to the current trunk version in your Subversion repository.
In an attempt to improve portability, libogg defines an assortment of types, like for example ogg_int32_t. This is done in os_types.h. The detection is based on various predefined #defines like _WIN32, MINGW32, BEOS etc.
If none of these #if/#elif checks works, os_types.h finally gives up and includes ogg/config_types.h. And config_types.h is in turn generated by your configure script to use suitable types
So far, so good. The problem now is that your configure script checks whether int16_t is present. it does so by including sys/types.h.
However, this is not portable. The proper ISO99-C header for int16_t is inttypes.h. You will now say: "But it works". It does so on many systems since often sys/types.h pulls in inttypes.h implicitly, and things work. Unless somebody tries to compile code while enforcing standard conformance, on OS X this can for example be achieved by doing: #define _XOPEN_SOURCE 600
which then leads to a compile error when including ogg/ogg.h unless one first includes inttypes.h or stdint.h
Proposed solution: Just don't use int16_t in config_types.h -- after all, it's meant to be your fallback code. If you want to use the int16_t etc. types if present, simply let your configure script #define HAS_INTTYPES_H and modify os_types.h by adding another branch that #includes <inttypes.h> and does the appropriate typedefs.
Sidenote: The check for MACOSX can be safely removed from os_types.h. No compiler for OS X that I know ever #defines this :-).