X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=libhb%2Fports.c;h=2e6b65329a9de6dde936a98c01b81bcc5a1c7114;hb=c593146bf3fab6290c71cbbb974e0a756e43f5e0;hp=2c3884436e596b368726c4030b4281beedae9d55;hpb=4980ef9d0ec9b1b984eb075d7880ba04317363d0;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/libhb/ports.c b/libhb/ports.c index 2c388443..2e6b6532 100644 --- a/libhb/ports.c +++ b/libhb/ports.c @@ -31,6 +31,11 @@ #include #endif +#ifdef SYS_MINGW +#include +#include +#endif + #ifdef SYS_SunOS #include #endif @@ -39,15 +44,15 @@ #include -//#ifdef SYS_CYGWIN -//#include -//#include -//#else +#ifdef SYS_MINGW +#include +#include +#else #include #include #include #include -//#endif +#endif #include "hb.h" @@ -97,7 +102,7 @@ void hb_snooze( int delay ) snooze( 1000 * delay ); #elif defined( SYS_DARWIN ) || defined( SYS_LINUX ) || defined( SYS_FREEBSD) || defined( SYS_SunOS ) usleep( 1000 * delay ); -#elif defined( SYS_CYGWIN ) +#elif defined( SYS_CYGWIN ) || defined( SYS_MINGW ) Sleep( delay ); #endif } @@ -119,7 +124,7 @@ int hb_get_cpu_count() } cpu_count = 1; -#if defined(SYS_CYGWIN) +#if defined(SYS_CYGWIN) || defined(SYS_MINGW) SYSTEM_INFO cpuinfo; GetSystemInfo( &cpuinfo ); cpu_count = cpuinfo.dwNumberOfProcessors; @@ -138,7 +143,7 @@ int hb_get_cpu_count() cpu_count = info.cpu_count; #elif defined(SYS_DARWIN) || defined(SYS_FREEBSD) || defined(SYS_OPENBSD) - size_t length = sizeof( numberOfCPUs ); + size_t length = sizeof( cpu_count ); #ifdef SYS_OPENBSD int mib[2] = { CTL_HW, HW_NCPU }; if( sysctl(mib, 2, &cpu_count, &length, NULL, 0) ) @@ -181,7 +186,7 @@ void hb_get_tempory_directory( hb_handle_t * h, char path[512] ) char base[512]; /* Create the base */ -#ifdef SYS_CYGWIN +#if defined( SYS_CYGWIN ) || defined( SYS_MINGW ) char *p; int i_size = GetTempPath( 512, base ); if( i_size <= 0 || i_size >= 512 ) @@ -227,11 +232,11 @@ void hb_get_tempory_filename( hb_handle_t * h, char name[1024], ***********************************************************************/ void hb_mkdir( char * name ) { -//#ifdef SYS_CYGWIN -// mkdir( name ); -//#else +#ifdef SYS_MINGW + mkdir( name ); +#else mkdir( name, 0755 ); -//#endif +#endif } /************************************************************************