Fixes that make avilib compile on cygwin by Shailesh L Mistry <shailesh.mistry@milan.eclipse.co.uk>

This commit is contained in:
Moritz Bunkus 2003-03-11 13:01:18 +00:00
parent 74f92a5d68
commit f87ad8e065
4 changed files with 54 additions and 1 deletions

View File

@ -29,14 +29,23 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
//SLM
#ifdef WIN32
#include <io.h>
#define STDOUT_FILENO fileno(stdout)
#else
#include <unistd.h> #include <unistd.h>
#endif
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#if defined(__bsdi__) || defined(__FreeBSD__) //SLM
#if defined(__bsdi__) || defined(__FreeBSD__) || defined WIN32
typedef off_t off64_t; typedef off_t off64_t;
#define lseek64 lseek #define lseek64 lseek
#endif #endif

View File

@ -25,6 +25,12 @@
* *
*/ */
//SLM
#ifdef WIN32
#include <io.h>
#define strncasecmp(a,b,c) _strnicmp(a,b,c)
#endif
#include "avilib.h" #include "avilib.h"
//#include <time.h> //#include <time.h>
@ -39,6 +45,12 @@ static char id_str[MAX_INFO_STRLEN];
#define FRAME_RATE_SCALE 1000000 #define FRAME_RATE_SCALE 1000000
//SLM
/* ssize_t not defined in vc6 */
#if !defined(ssize_t)
typedef int ssize_t;
#endif
/******************************************************************* /*******************************************************************
* * * *
* Utilities for writing an AVI File * * Utilities for writing an AVI File *
@ -191,6 +203,22 @@ static int avi_add_index_entry(avi_t *AVI, unsigned char *tag, long flags, unsig
return 0; return 0;
} }
//SLM
#ifndef S_IRUSR
#define S_IRWXU 00700 /* read, write, execute: owner */
#define S_IRUSR 00400 /* read permission: owner */
#define S_IWUSR 00200 /* write permission: owner */
#define S_IXUSR 00100 /* execute permission: owner */
#define S_IRWXG 00070 /* read, write, execute: group */
#define S_IRGRP 00040 /* read permission: group */
#define S_IWGRP 00020 /* write permission: group */
#define S_IXGRP 00010 /* execute permission: group */
#define S_IRWXO 00007 /* read, write, execute: other */
#define S_IROTH 00004 /* read permission: other */
#define S_IWOTH 00002 /* write permission: other */
#define S_IXOTH 00001 /* execute permission: other */
#endif
/* /*
AVI_open_output_file: Open an AVI File and write a bunch AVI_open_output_file: Open an AVI File and write a bunch
of zero bytes as space for the header. of zero bytes as space for the header.

View File

@ -29,8 +29,18 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
//SLM
#ifdef WIN32
#define uint16_t unsigned __int16
#define uint32_t unsigned __int32
#define uint64_t unsigned __int64
#else
#include <unistd.h> #include <unistd.h>
#include <inttypes.h> #include <inttypes.h>
#endif
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -23,7 +23,13 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
//SLM
#ifdef WIN32
#else
#include <unistd.h> #include <unistd.h>
#endif
#include <sys/stat.h> #include <sys/stat.h>
#include <string.h> #include <string.h>