/*
 * Copyright 2015 Telenav Inc. All rights reserved.
 */
#ifndef TN_FOUNDATION_STDIO_UNLOCKED_HPP
#define TN_FOUNDATION_STDIO_UNLOCKED_HPP

#include <stdio.h>
#include "foundation/private/config.hpp"

// We can't put them in namespace because on (at least some) POSIX systems they are 
// implemented as macros, not functions.
#if !TN_PLATFORM_UNIX
inline void flockfile(FILE *file) {;}
inline void funlockfile(FILE *file) {;}
inline int ftrylockfile(FILE *file) { return 0; }
inline int getc_unlocked(FILE *file) { return ::getc(file); }
inline int getchar_unlocked() { return ::getchar(); }
inline int putc_unlocked(int c, FILE *file) { return ::putc(c,file); }
inline int putchar_unlocked(int c) { return ::putchar(c); }
#endif
 
#endif /* TN_FOUNDATION_STDIO_UNLOCKED_HPP */
