view dep/animia/src/fd.cc @ 150:ffa535b6d630

*: avoid usage of std::[pair,tuple] https://arne-mertz.de/2017/03/smelly-pair-tuple/ it's better to use real structures and such where variables are easily known... also apparently using [] on structs is actually valid? I had no idea.
author Paper <mrpapersonic@gmail.com>
date Tue, 14 Nov 2023 16:27:33 -0500
parents d8a61e7e2a36
children 8700806c2cc2
line wrap: on
line source

#include "animia/os.h"
#include "animia/fd.h"

#ifdef ANIMIA_ON_WIN32
#	include "animia/fd/win32.h"
#elif defined(ANIMIA_ON_LINUX)
#	include "animia/fd/linux.h"
#elif defined(ANIMIA_ON_UNIX)
#	include "animia/fd/bsd.h"
#endif

namespace animia::internal {

/* really stupid hack to get fd to point to the right
   thing */
#ifdef ANIMIA_ON_WIN32
win32::Win32FdTools os_fd;
#elif defined(ANIMIA_ON_LINUX)
linux::LinuxFdTools os_fd;
#elif defined(ANIMIA_ON_UNIX)
unix::UnixFdTools os_fd;
#else
BaseFdTools os_fd;
#endif

BaseFdTools& fd = os_fd;

}