Changeset 51002a6c98cafc33e01f06eb2214612d4d983309
- Timestamp:
- 01/10/04 17:56:10
(4 years ago)
- Author:
- Gildas Bazin <gbazin@videolan.org>
- git-committer:
- Gildas Bazin <gbazin@videolan.org> 1096646170 +0000
- git-parent:
[5cfa14809653862339f2234893d6883cbed78810]
- git-author:
- Gildas Bazin <gbazin@videolan.org> 1096646170 +0000
- Message:
* src/*: WinCE compilation fixes.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r053a3a7 |
r51002a6 |
|
| 60 | 60 | vlc_list_t * p_list; |
|---|
| 61 | 61 | |
|---|
| 62 | | #if defined( WIN32 ) && !defined( __MINGW32__ ) |
|---|
| | 62 | #if (defined( WIN32 ) && !defined( __MINGW32__ )) || defined( UNDER_CE ) |
|---|
| 63 | 63 | signed __int64 i_time; |
|---|
| 64 | 64 | # else |
|---|
| rcb98a99 |
r51002a6 |
|
| 923 | 923 | if( CreateDirectory( psz_new, NULL ) ) |
|---|
| 924 | 924 | { |
|---|
| 925 | | msg_Err( p_this, "could not create %s", psz_filename ); |
|---|
| | 925 | msg_Err( p_this, "could not create %s", psz_dirname ); |
|---|
| 926 | 926 | } |
|---|
| 927 | 927 | } |
|---|
| … | … | |
| 1555 | 1555 | typedef HRESULT (WINAPI *SHGETFOLDERPATH)( HWND, int, HANDLE, DWORD, |
|---|
| 1556 | 1556 | LPSTR ); |
|---|
| | 1557 | #ifndef CSIDL_FLAG_CREATE |
|---|
| 1557 | 1558 | # define CSIDL_FLAG_CREATE 0x8000 |
|---|
| | 1559 | #endif |
|---|
| | 1560 | #ifndef CSIDL_APPDATA |
|---|
| 1558 | 1561 | # define CSIDL_APPDATA 0x1A |
|---|
| | 1562 | #endif |
|---|
| | 1563 | #ifndef SHGFP_TYPE_CURRENT |
|---|
| 1559 | 1564 | # define SHGFP_TYPE_CURRENT 0 |
|---|
| | 1565 | #endif |
|---|
| 1560 | 1566 | |
|---|
| 1561 | 1567 | HINSTANCE shfolder_dll; |
|---|
| r2ba646a |
r51002a6 |
|
| 30 | 30 | |
|---|
| 31 | 31 | #include <string.h> |
|---|
| 32 | | #include <errno.h> |
|---|
| | 32 | #ifdef HAVE_ERRNO_H |
|---|
| | 33 | # include <errno.h> |
|---|
| | 34 | #endif |
|---|
| 33 | 35 | #ifdef HAVE_UNISTD_H |
|---|
| 34 | 36 | # include <unistd.h> |
|---|
| 35 | 37 | #endif |
|---|
| 36 | | #include <fcntl.h> |
|---|
| | 38 | |
|---|
| | 39 | #ifdef HAVE_FCNTL_H |
|---|
| | 40 | # include <fcntl.h> |
|---|
| | 41 | #endif |
|---|
| 37 | 42 | |
|---|
| 38 | 43 | #if defined( UNDER_CE ) |
|---|
| … | … | |
| 2338 | 2343 | &fds_read, &fds_write, NULL, &timeout ); |
|---|
| 2339 | 2344 | |
|---|
| | 2345 | #if defined( WIN32 ) || defined( UNDER_CE ) |
|---|
| | 2346 | if( i_ret == -1 ) |
|---|
| | 2347 | #else |
|---|
| 2340 | 2348 | if( i_ret == -1 && errno != EINTR ) |
|---|
| | 2349 | #endif |
|---|
| 2341 | 2350 | { |
|---|
| 2342 | 2351 | msg_Warn( host, "cannot select sockets" ); |
|---|
| r2ba646a |
r51002a6 |
|
| 189 | 189 | |
|---|
| 190 | 190 | i_ret = select(fd + 1, &fds_r, NULL, &fds_e, &timeout); |
|---|
| | 191 | #ifdef HAVE_ERRNO_H |
|---|
| 191 | 192 | if( (i_ret < 0 && errno == EINTR) || i_ret == 0 ) |
|---|
| | 193 | #else |
|---|
| | 194 | if( i_ret == 0 ) |
|---|
| | 195 | #endif |
|---|
| 192 | 196 | { |
|---|
| 193 | 197 | if( b_block ) continue; |
|---|
| … | … | |
| 196 | 200 | else if( i_ret < 0 ) |
|---|
| 197 | 201 | { |
|---|
| 198 | | #ifdef WIN32 |
|---|
| | 202 | #if defined(WIN32) || defined(UNDER_CE) |
|---|
| 199 | 203 | msg_Err( p_this, "network select error (%i)", WSAGetLastError() ); |
|---|
| 200 | 204 | #else |
|---|
| … | … | |
| 206 | 210 | if( ( i_ret = accept( fd, 0, 0 ) ) <= 0 ) |
|---|
| 207 | 211 | { |
|---|
| 208 | | #ifdef WIN32 |
|---|
| | 212 | #if defined(WIN32) || defined(UNDER_CE) |
|---|
| 209 | 213 | msg_Err( p_this, "accept failed (%i)", WSAGetLastError() ); |
|---|
| 210 | 214 | #else |
|---|
| … | … | |
| 330 | 334 | |
|---|
| 331 | 335 | } while( (i_ret = select(fd + 1, &fds_r, NULL, &fds_e, &timeout)) == 0 |
|---|
| | 336 | #ifdef HAVE_ERRNO_H |
|---|
| 332 | 337 | || ( i_ret < 0 && errno == EINTR ) ); |
|---|
| | 338 | #else |
|---|
| | 339 | ); |
|---|
| | 340 | #endif |
|---|
| 333 | 341 | |
|---|
| 334 | 342 | if( i_ret < 0 ) |
|---|
| 335 | 343 | { |
|---|
| | 344 | #if defined(WIN32) || defined(UNDER_CE) |
|---|
| | 345 | msg_Err( p_this, "network select error" ); |
|---|
| | 346 | #else |
|---|
| 336 | 347 | msg_Err( p_this, "network select error (%s)", strerror(errno) ); |
|---|
| | 348 | #endif |
|---|
| 337 | 349 | return i_total > 0 ? i_total : -1; |
|---|
| 338 | 350 | } |
|---|
| … | … | |
| 340 | 352 | if( ( i_recv = recv( fd, p_data, i_data, 0 ) ) < 0 ) |
|---|
| 341 | 353 | { |
|---|
| 342 | | #ifdef WIN32 |
|---|
| | 354 | #if defined(WIN32) || defined(UNDER_CE) |
|---|
| 343 | 355 | /* For udp only */ |
|---|
| 344 | 356 | /* On win32 recv() will fail if the datagram doesn't fit inside |
|---|
| … | … | |
| 399 | 411 | i_ret = select(fd + 1, &fds_r, NULL, &fds_e, &timeout); |
|---|
| 400 | 412 | |
|---|
| | 413 | #ifdef HAVE_ERRNO_H |
|---|
| 401 | 414 | if( i_ret < 0 && errno == EINTR ) |
|---|
| | 415 | #else |
|---|
| | 416 | if( 0 ) |
|---|
| | 417 | #endif |
|---|
| 402 | 418 | { |
|---|
| 403 | 419 | return 0; |
|---|
| … | … | |
| 405 | 421 | else if( i_ret < 0 ) |
|---|
| 406 | 422 | { |
|---|
| | 423 | #if defined(WIN32) || defined(UNDER_CE) |
|---|
| | 424 | msg_Err( p_this, "network select error" ); |
|---|
| | 425 | #else |
|---|
| 407 | 426 | msg_Err( p_this, "network select error (%s)", strerror(errno) ); |
|---|
| | 427 | #endif |
|---|
| 408 | 428 | return -1; |
|---|
| 409 | 429 | } |
|---|
| … | … | |
| 414 | 434 | else |
|---|
| 415 | 435 | { |
|---|
| 416 | | if( fd == 0 /*STDIN_FILENO*/ ) i_recv = read( fd, p_data, i_data ); else |
|---|
| | 436 | #if !defined(UNDER_CE) |
|---|
| | 437 | if( fd == 0/*STDIN_FILENO*/ ) i_recv = read( fd, p_data, i_data ); else |
|---|
| | 438 | #endif |
|---|
| 417 | 439 | if( ( i_recv = recv( fd, p_data, i_data, 0 ) ) <= 0 ) |
|---|
| 418 | 440 | { |
|---|
| 419 | | #ifdef WIN32 |
|---|
| | 441 | #if defined(WIN32) || defined(UNDER_CE) |
|---|
| 420 | 442 | /* For udp only */ |
|---|
| 421 | 443 | /* On win32 recv() will fail if the datagram doesn't fit inside |
|---|
| … | … | |
| 473 | 495 | |
|---|
| 474 | 496 | } while( (i_ret = select(fd + 1, NULL, &fds_w, &fds_e, &timeout)) == 0 |
|---|
| | 497 | #ifdef HAVE_ERRNO_H |
|---|
| 475 | 498 | || ( i_ret < 0 && errno == EINTR ) ); |
|---|
| | 499 | #else |
|---|
| | 500 | ); |
|---|
| | 501 | #endif |
|---|
| 476 | 502 | |
|---|
| 477 | 503 | if( i_ret < 0 ) |
|---|
| 478 | 504 | { |
|---|
| | 505 | #if defined(WIN32) || defined(UNDER_CE) |
|---|
| | 506 | msg_Err( p_this, "network select error" ); |
|---|
| | 507 | #else |
|---|
| 479 | 508 | msg_Err( p_this, "network select error (%s)", strerror(errno) ); |
|---|
| | 509 | #endif |
|---|
| 480 | 510 | return i_total > 0 ? i_total : -1; |
|---|
| 481 | 511 | } |
|---|
| r99e83fd |
r51002a6 |
|
| 1131 | 1131 | schedule->b_enabled = VLC_FALSE; |
|---|
| 1132 | 1132 | } |
|---|
| | 1133 | #if !defined( UNDER_CE ) |
|---|
| 1133 | 1134 | else if( strcmp( psz_cmd, "date" ) == 0 ) |
|---|
| 1134 | 1135 | { |
|---|
| … | … | |
| 1282 | 1283 | schedule->i_period = ((mtime_t) date) * 1000000; |
|---|
| 1283 | 1284 | } |
|---|
| | 1285 | #endif /* UNDER_CE */ |
|---|
| 1284 | 1286 | else if( strcmp( psz_cmd, "repeat" ) == 0 ) |
|---|
| 1285 | 1287 | { |
|---|
| … | … | |
| 1453 | 1455 | "yes" : "no" ) ); |
|---|
| 1454 | 1456 | |
|---|
| | 1457 | #if !defined( UNDER_CE ) |
|---|
| 1455 | 1458 | if( schedule->i_date != 0 ) |
|---|
| 1456 | 1459 | { |
|---|
| … | … | |
| 1506 | 1509 | vlm_MessageAdd( msg_schedule, vlm_MessageNew("period", "0") ); |
|---|
| 1507 | 1510 | } |
|---|
| | 1511 | #endif /* UNDER_CE */ |
|---|
| 1508 | 1512 | |
|---|
| 1509 | 1513 | sprintf( buffer, "%d", schedule->i_repeat ); |
|---|
| … | … | |
| 1618 | 1622 | time_t i_date = (time_t) (i_next_date / 1000000) ; |
|---|
| 1619 | 1623 | |
|---|
| | 1624 | #if !defined( UNDER_CE ) |
|---|
| 1620 | 1625 | #ifdef HAVE_CTIME_R |
|---|
| 1621 | 1626 | char psz_date[500]; |
|---|
| … | … | |
| 1627 | 1632 | vlm_MessageAdd( msg_schedule, |
|---|
| 1628 | 1633 | vlm_MessageNew( "next launch", psz_date ) ); |
|---|
| | 1634 | #endif |
|---|
| 1629 | 1635 | } |
|---|
| 1630 | 1636 | } |
|---|
| … | … | |
| 1893 | 1899 | |
|---|
| 1894 | 1900 | /* and now, the schedule scripts */ |
|---|
| 1895 | | |
|---|
| | 1901 | #if !defined( UNDER_CE ) |
|---|
| 1896 | 1902 | for( i = 0; i < vlm->i_schedule; i++ ) |
|---|
| 1897 | 1903 | { |
|---|
| … | … | |
| 1963 | 1969 | |
|---|
| 1964 | 1970 | } |
|---|
| | 1971 | #endif /* UNDER_CE */ |
|---|
| 1965 | 1972 | |
|---|
| 1966 | 1973 | return save; |
|---|