rvthtool/cmake/macros/LargeFileSupport_fseeko.c
David Korth f321fe5e65 Initial import of RVT-H Tool.
This program will allow for managing Nintendo RVT-H Reader devkits,
including dumping existing images and installing new images.

The current version doesn't actually do anything. It's mostly a copy
of the infrastructure from rom-properties, with some changes. In
particular, we're using CMake's TARGET_COMPILE_FEATURES() instead of
manually detecting C99 support.
2018-01-15 06:58:54 -05:00

20 lines
560 B
C

/**
* Large File Support test code: fseeko(), ftello() [LFS]
* Reference: https://github.com/Benjamin-Dobell/Heimdall/blob/master/cmake/LargeFiles.c
*/
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
/** static_assert() macro copied from c++11-compat.h **/
#define static_assert(expr, msg) switch (0) { case 0: case (expr): ; }
int main(int argc, const char **argv)
{
static_assert(sizeof(off_t) == sizeof(int64_t), "off_t is the wrong size");
off_t offset = ftello(NULL);
fseeko(NULL, offset, SEEK_SET);
return 0;
}