1 /***************************************************************************** 2 * osdep.h: 3 ***************************************************************************** 4 * Copyright (C) 2010-2017 L-SMASH project 5 * 6 * Authors: Yusuke Nakamura <muken.the.vfrmaniac@gmail.com> 7 * Takashi Hirata <silverfilain@gmail.com> 8 * 9 * Permission to use, copy, modify, and/or distribute this software for any 10 * purpose with or without fee is hereby granted, provided that the above 11 * copyright notice and this permission notice appear in all copies. 12 * 13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20 *****************************************************************************/ 21 22 /* This file is available under an ISC license. */ 23 24 #ifndef OSDEP_H 25 #define OSDEP_H 26 27 #define _FILE_OFFSET_BITS 64 28 #define _LARGEFILE_SOURCE 29 30 #if defined( _MSC_VER ) 31 #define lsmash_fseek _fseeki64 32 #define lsmash_ftell _ftelli64 33 #elif defined( __MINGW32__ ) 34 #define lsmash_fseek fseeko64 35 #define lsmash_ftell ftello64 36 #else 37 #define _POSIX_C_SOURCE 200809L 38 #define lsmash_fseek fseeko 39 #define lsmash_ftell ftello 40 #endif 41 42 #ifdef _MSC_VER 43 #define inline __inline 44 #define _CRT_SECURE_NO_WARNINGS 45 #endif 46 47 #ifdef _WIN32 48 # include <stdio.h> 49 FILE *lsmash_win32_fopen( const char *name, const char *mode ); 50 # define lsmash_fopen lsmash_win32_fopen 51 #else 52 # define lsmash_fopen fopen 53 #endif 54 55 #ifdef _WIN32 56 # include <wchar.h> 57 int lsmash_string_to_wchar( int cp, const char *from, wchar_t **to ); 58 int lsmash_string_from_wchar( int cp, const wchar_t *from, char **to ); 59 #endif 60 61 #endif 62