Skip to content

Commit

Permalink
windows: get the build working further. part 3 (includes/config stuff)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriweb committed Nov 19, 2023
1 parent af3c1dc commit 46e59dd
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Makefile.in
aclocal.m4
autom4te.cache/
config.*
!win32_config/config.h
configure
depcomp
install-sh
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ elseif(MINGW)
add_compile_definitions(__MINGW32__)
elseif(WIN32)
add_compile_definitions(__WIN32__)
add_compile_definitions(HAVE_CONFIG_H)
include_directories(${CMAKE_SOURCE_DIR}/win32_config)
endif()

# i18n support checking
Expand Down
2 changes: 2 additions & 0 deletions libticables/trunk/src/linux/link_usb1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
#endif

#ifdef __WIN32__
#ifndef _WINSOCKAPI_
#include <winsock2.h> /* struct timeval */
#endif
#else
#include <unistd.h>
#include <sys/time.h>
Expand Down
1 change: 1 addition & 0 deletions libticables/trunk/src/timeout.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ typedef unsigned long tiTIME;

#if defined(__WIN32__) && !defined(__MINGW32__)

# include <sysinfoapi.h>
# define TO_START(ref) { (ref) = GetTickCount(); }
# define TO_CURRENT(ref) ( GetTickCount() - (ref) )
# define TO_ELAPSED(ref, max) ( TO_CURRENT(ref) > (100UL*(max)) )
Expand Down
8 changes: 8 additions & 0 deletions libticables/trunk/src/win64/rwp.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#ifndef __RWP_H__
#define __RWP_H__

#ifdef __cplusplus
extern "C" {
#endif

int rwp_detect(int* result);

int rwp_open(void);
Expand All @@ -30,4 +34,8 @@ int rwp_close(void);
int rwp_read_byte(unsigned short address, unsigned char *data);
int rwp_write_byte(unsigned short address, unsigned char data);

#ifdef __cplusplus
}
#endif

#endif
8 changes: 8 additions & 0 deletions libticalcs/trunk/src/romdump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
This unit manages common ROM dumper.
*/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdio.h>
#include <string.h>
#include <glib/gstdio.h>
Expand All @@ -34,6 +38,10 @@
#include "error.h"
#include "romdump.h"

#ifdef __WIN32__
#include <io.h>
#endif

#define MAX_RETRY 3

/* CMD | LEN | DATA | CHK */
Expand Down
4 changes: 4 additions & 0 deletions libtifiles/trunk/src/tigroup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
#include "error.h"
#include "rwfile.h"

#ifdef __WIN32__
#include <io.h>
#endif

// Whether to print detailed information about TigEntry, TigContent instances throughout their lifecycle.
//#define TRACE_CONTENT_INSTANCES

Expand Down
7 changes: 7 additions & 0 deletions win32_config/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef ROOT_CONFIG_H
#define ROOT_CONFIG_H

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#endif

0 comments on commit 46e59dd

Please sign in to comment.