diff --git a/src/compat/internal.h b/src/compat/internal.h index 47d32cd..d1c342c 100644 --- a/src/compat/internal.h +++ b/src/compat/internal.h @@ -33,14 +33,16 @@ # if defined(__MINGW32__) || defined(__MINGW64__) -# include "off_t.h" +# if defined(__STRICT_ANSI__) || defined(MINGW_DEFINE_OFF_T) +# include "off_t.h" -# if !defined(__MINGW64__) -# define off_t cr_off32 -# else -# define off_t cr_off64 +# if !defined(__MINGW64__) +# define off_t cr_off32 +# else +# define off_t cr_off64 +# endif +# define off64_t cr_off64 # endif -# define off64_t cr_off64 # endif # include # if defined(__MINGW32__) || defined(__MINGW64__) diff --git a/src/compat/off_t.h b/src/compat/off_t.h index 24dc65d..5918cea 100644 --- a/src/compat/off_t.h +++ b/src/compat/off_t.h @@ -1,9 +1,32 @@ -#ifndef OFF_T_H_ -# define OFF_T_H_ +/* + * The MIT License (MIT) + * + * Copyright © 2015 Franklin "Snaipe" Mathieu + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef CR_OFF_T_DEFINED +# define CR_OFF_T_DEFINED # include typedef int32_t cr_off32; typedef int64_t cr_off64; -#endif /* !OFF_T_H_ */ +#endif /* !CR_OFF_T_DEFINED */ diff --git a/src/compat/posix.h b/src/compat/posix.h index 81af6b3..0a7bbda 100644 --- a/src/compat/posix.h +++ b/src/compat/posix.h @@ -42,14 +42,16 @@ # endif # if defined(__MINGW32__) || defined(__MINGW64__) -# include "off_t.h" +# if defined(__STRICT_ANSI__) || defined(MINGW_DEFINE_OFF_T) +# include "off_t.h" -# if !defined(__MINGW64__) -# define off_t cr_off32 -# else -# define off_t cr_off64 +# if !defined(__MINGW64__) +# define off_t cr_off32 +# else +# define off_t cr_off64 +# endif +# define off64_t cr_off64 # endif -# define off64_t cr_off64 # endif # include # include