Skip to content

Commit

Permalink
Improve windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
plzombie committed Nov 27, 2022
1 parent 48c45a8 commit f8d239c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion autotest1.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <sys/types.h>
#include <fcntl.h>
#if defined(WIN32)
#if defined(_WIN32)
#include <io.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion hello.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <sys/types.h>
#include <fcntl.h>
#if defined(WIN32)
#if defined(_WIN32)
#include <io.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion hello2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <sys/types.h>
#include <fcntl.h>
#if defined(WIN32)
#if defined(_WIN32)
#include <io.h>
#endif

Expand Down
6 changes: 0 additions & 6 deletions helloa.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
#include <stdio.h>
#include <locale.h>

#include <sys/types.h>
#include <fcntl.h>
#if defined(WIN32)
#include <io.h>
#endif

int main(void)
{
iuliia_scheme_t *scheme = 0;
Expand Down
8 changes: 4 additions & 4 deletions iuliia.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#if defined(WIN32)
#if defined(_WIN32)
#include <Windows.h>
#else
#define _LARGEFILE_SOURCE
Expand Down Expand Up @@ -50,7 +50,7 @@ static bool iuliiaIntJsonLoadStringW(struct json_value_s *value, wchar_t **str)
if(!(*str)) return false;
(*str)[val->string_size] = 0;

#if defined(WIN32)
#if defined(_WIN32)
MultiByteToWideChar(CP_UTF8, 0, val->string, (int)(val->string_size+1), *str, (int)(val->string_size+1));
#else
mbstowcs(*str, val->string, val->string_size);
Expand Down Expand Up @@ -317,7 +317,7 @@ iuliia_scheme_t *iuliiaLoadSchemeFromFile(FILE *f)

if(fseek(f, 0, SEEK_END)) return 0;

#if defined(WIN32)
#if defined(_WIN32)
f_size = _ftelli64(f);
#else
f_size = ftello64(f);
Expand Down Expand Up @@ -345,7 +345,7 @@ iuliia_scheme_t *iuliiaLoadSchemeFromFile(FILE *f)
return scheme;
}

#if !defined(WIN32)
#if !defined(_WIN32)
FILE *_wfopen(const wchar_t* filename, const wchar_t* mode)
{
size_t filename_len, mode_len;
Expand Down

0 comments on commit f8d239c

Please sign in to comment.