michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/event/async_wait.h b/media/mtransport/third_party/nrappkit/src/event/async_wait.h michael@0: --- a/media/mtransport/third_party/nrappkit/src/event/async_wait.h michael@0: +++ b/media/mtransport/third_party/nrappkit/src/event/async_wait.h michael@0: @@ -38,21 +38,21 @@ michael@0: michael@0: michael@0: #ifndef _async_wait_h michael@0: #define _async_wait_h michael@0: michael@0: #ifdef HAVE_SYS_TIME_H michael@0: #include michael@0: #endif michael@0: #include michael@0: michael@0: -typedef void (*NR_async_cb)(int resource,int how,void *arg); michael@0: +typedef void (*NR_async_cb)(NR_SOCKET resource,int how,void *arg); michael@0: michael@0: #define NR_ASYNC_WAIT_READ 0 michael@0: #define NR_ASYNC_WAIT_WRITE 1 michael@0: michael@0: michael@0: int NR_async_wait_init(void); michael@0: int NR_async_wait(NR_SOCKET sock, int how, NR_async_cb cb,void *cb_arg, michael@0: char *function,int line); michael@0: int NR_async_cancel(NR_SOCKET sock,int how); michael@0: int NR_async_schedule(NR_async_cb cb,void *arg,char *function,int line); michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/log/r_log.c b/media/mtransport/third_party/nrappkit/src/log/r_log.c michael@0: --- a/media/mtransport/third_party/nrappkit/src/log/r_log.c michael@0: +++ b/media/mtransport/third_party/nrappkit/src/log/r_log.c michael@0: @@ -33,28 +33,41 @@ michael@0: POSSIBILITY OF SUCH DAMAGE. michael@0: michael@0: michael@0: ekr@rtfm.com Mon Dec 3 15:24:38 2001 michael@0: */ michael@0: michael@0: michael@0: static char *RCSSTRING __UNUSED__ ="$Id: r_log.c,v 1.10 2008/11/25 22:25:18 adamcain Exp $"; michael@0: michael@0: michael@0: +#ifdef LINUX michael@0: +#define _BSD_SOURCE michael@0: +#endif michael@0: + michael@0: #include "r_log.h" michael@0: #include "hex.h" michael@0: + michael@0: #include michael@0: +#include michael@0: +#ifndef _MSC_VER michael@0: +#include michael@0: +#include michael@0: +#endif michael@0: #include michael@0: #include michael@0: + michael@0: + michael@0: #include "nr_common.h" michael@0: #include "nr_reg_keys.h" michael@0: michael@0: + michael@0: #define LOGGING_DEFAULT_LEVEL 5 michael@0: michael@0: int NR_LOG_LOGGING = 0; michael@0: michael@0: static char *log_level_strings[]={ michael@0: "EMERG", michael@0: "ALERT", michael@0: "CRIT", michael@0: "ERR", michael@0: "WARNING", michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/port/darwin/include/csi_platform.h b/media/mtransport/third_party/nrappkit/src/port/darwin/include/csi_platform.h michael@0: --- a/media/mtransport/third_party/nrappkit/src/port/darwin/include/csi_platform.h michael@0: +++ b/media/mtransport/third_party/nrappkit/src/port/darwin/include/csi_platform.h michael@0: @@ -37,17 +37,21 @@ michael@0: */ michael@0: michael@0: michael@0: #ifndef _platform_h michael@0: #define _platform_h michael@0: michael@0: #include michael@0: michael@0: #define STDIO_BYTES_BUFFERED(fp) (fp->_r) michael@0: michael@0: +#ifdef NR_SOCKET_IS_VOID_PTR michael@0: +typedef void* NR_SOCKET; michael@0: +#else michael@0: typedef int NR_SOCKET; michael@0: #define NR_SOCKET_READ(sock,buf,count) read((sock),(buf),(count)) michael@0: #define NR_SOCKET_WRITE(sock,buf,count) write((sock),(buf),(count)) michael@0: #define NR_SOCKET_CLOSE(sock) close(sock) michael@0: +#endif michael@0: michael@0: #endif michael@0: michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/port/linux/include/csi_platform.h b/media/mtransport/third_party/nrappkit/src/port/linux/include/csi_platform.h michael@0: --- a/media/mtransport/third_party/nrappkit/src/port/linux/include/csi_platform.h michael@0: +++ b/media/mtransport/third_party/nrappkit/src/port/linux/include/csi_platform.h michael@0: @@ -35,17 +35,21 @@ michael@0: michael@0: ekr@rtfm.com Mon Dec 13 17:26:51 2004 michael@0: */ michael@0: michael@0: michael@0: #ifndef _platform_h michael@0: #define _platform_h michael@0: michael@0: #include michael@0: michael@0: +#ifdef NR_SOCKET_IS_VOID_PTR michael@0: +typedef void* NR_SOCKET; michael@0: +#else michael@0: typedef int NR_SOCKET; michael@0: #define NR_SOCKET_READ(sock,buf,count) read((sock),(buf),(count)) michael@0: #define NR_SOCKET_WRITE(sock,buf,count) write((sock),(buf),(count)) michael@0: #define NR_SOCKET_CLOSE(sock) close(sock) michael@0: +#endif michael@0: michael@0: #endif michael@0: michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/port/win32/include/csi_platform.h b/media/mtransport/third_party/nrappkit/src/port/win32/include/csi_platform.h michael@0: --- a/media/mtransport/third_party/nrappkit/src/port/win32/include/csi_platform.h michael@0: +++ b/media/mtransport/third_party/nrappkit/src/port/win32/include/csi_platform.h michael@0: @@ -44,45 +44,51 @@ michael@0: #define _WIN32_WINNT 0x0400 // This prevents weird "'TryEnterCriticalSection': identifier not found" michael@0: // compiler errors when poco/win32_mutex.h is included michael@0: #endif michael@0: michael@0: #define UINT8 UBLAH_IGNORE_ME_PLEASE michael@0: #define INT8 BLAH_IGNORE_ME_PLEASE michael@0: #include michael@0: #undef UINT8 michael@0: #undef INT8 michael@0: #include michael@0: +#include michael@0: michael@0: #define strcasecmp _stricmp michael@0: #define strncasecmp _strnicmp michael@0: -#define snprintf _snprintf michael@0: michael@0: #define strcasestr stristr michael@0: michael@0: /* Hack version of strlcpy (in util/util.c) */ michael@0: size_t strlcat(char *dst, const char *src, size_t siz); michael@0: michael@0: /* Hack version of getopt() (in util/getopt.c) */ michael@0: int getopt(int argc, char *argv[], char *opstring); michael@0: extern char *optarg; michael@0: extern int optind; michael@0: extern int opterr; michael@0: michael@0: /* Hack version of gettimeofday() (in util/util.c) */ michael@0: int gettimeofday(struct timeval *tv, void *tz); michael@0: michael@0: +#ifdef NR_SOCKET_IS_VOID_PTR michael@0: +typedef void* NR_SOCKET; michael@0: +#else michael@0: typedef SOCKET NR_SOCKET; michael@0: #define NR_SOCKET_READ(sock,buf,count) recv((sock),(buf),(count),0) michael@0: #define NR_SOCKET_WRITE(sock,buf,count) send((sock),(buf),(count),0) michael@0: #define NR_SOCKET_CLOSE(sock) closesocket(sock) michael@0: +#endif michael@0: michael@0: +#ifndef EHOSTUNREACH michael@0: #define EHOSTUNREACH WSAEHOSTUNREACH michael@0: +#endif michael@0: michael@0: #define LOG_EMERG 0 michael@0: #define LOG_ALERT 1 michael@0: #define LOG_CRIT 2 michael@0: #define LOG_ERR 3 michael@0: #define LOG_WARNING 4 michael@0: #define LOG_NOTICE 5 michael@0: #define LOG_INFO 6 michael@0: #define LOG_DEBUG 7 michael@0: michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/registry/registry.c b/media/mtransport/third_party/nrappkit/src/registry/registry.c michael@0: --- a/media/mtransport/third_party/nrappkit/src/registry/registry.c michael@0: +++ b/media/mtransport/third_party/nrappkit/src/registry/registry.c michael@0: @@ -37,21 +37,22 @@ michael@0: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN michael@0: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) michael@0: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE michael@0: * POSSIBILITY OF SUCH DAMAGE. michael@0: * michael@0: * michael@0: */ michael@0: michael@0: #include michael@0: #include michael@0: -#ifndef WIN32 michael@0: +#ifndef _MSC_VER michael@0: +#include michael@0: #include michael@0: #include michael@0: #endif michael@0: #ifdef OPENSSL michael@0: #include michael@0: #endif michael@0: #include michael@0: #include "registry.h" michael@0: #include "registry_int.h" michael@0: #include "registry_vtbl.h" michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/util/libekr/r_crc32.c b/media/mtransport/third_party/nrappkit/src/util/libekr/r_crc32.c michael@0: --- a/media/mtransport/third_party/nrappkit/src/util/libekr/r_crc32.c michael@0: +++ b/media/mtransport/third_party/nrappkit/src/util/libekr/r_crc32.c michael@0: @@ -58,20 +58,21 @@ michael@0: * the crc computation is finished. The crc should be complemented michael@0: * before transmission. michael@0: * The variable corresponding to the macro argument "crc" should michael@0: * be an unsigned long and should be preset to all ones for Ethernet michael@0: * use. An error-free packet will leave 0xDEBB20E3 in the crc. michael@0: * Spencer Garrett michael@0: */ michael@0: michael@0: michael@0: #include michael@0: +#include michael@0: michael@0: static char *RCSSTRING __UNUSED__ ="$Id: r_crc32.c,v 1.4 2008/11/26 03:22:02 adamcain Exp $"; michael@0: michael@0: #ifdef WIN32 michael@0: #define u_int32_t UINT4 michael@0: #endif michael@0: michael@0: #define CRC(crc, ch) (crc = (crc >> 8) ^ crctab[(crc ^ (ch)) & 0xff]) michael@0: michael@0: /* generated using the AUTODIN II polynomial michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/util/libekr/r_macros.h b/media/mtransport/third_party/nrappkit/src/util/libekr/r_macros.h michael@0: --- a/media/mtransport/third_party/nrappkit/src/util/libekr/r_macros.h michael@0: +++ b/media/mtransport/third_party/nrappkit/src/util/libekr/r_macros.h michael@0: @@ -118,20 +118,20 @@ michael@0: #ifndef MIN michael@0: #define MIN(a,b) ((a)>(b))?(b):(a) michael@0: #endif michael@0: michael@0: #ifndef MAX michael@0: #define MAX(a,b) ((b)>(a))?(b):(a) michael@0: #endif michael@0: michael@0: #ifdef DEBUG michael@0: #define DBG(a) debug a michael@0: -int debug(int class,char *format,...); michael@0: +int debug(int cls, char *format,...); michael@0: #else michael@0: #define DBG(a) michael@0: #endif michael@0: michael@0: #define UNIMPLEMENTED do { fprintf(stderr,"%s:%d Function %s unimplemented\n",__FILE__,__LINE__,__FUNCTION__); abort(); } while(0) michael@0: michael@0: #include "r_memory.h" michael@0: michael@0: #endif michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/util/libekr/r_time.h b/media/mtransport/third_party/nrappkit/src/util/libekr/r_time.h michael@0: --- a/media/mtransport/third_party/nrappkit/src/util/libekr/r_time.h michael@0: +++ b/media/mtransport/third_party/nrappkit/src/util/libekr/r_time.h michael@0: @@ -77,35 +77,25 @@ michael@0: $Id: r_time.h,v 1.4 2007/06/26 22:37:57 adamcain Exp $ michael@0: michael@0: michael@0: ekr@rtfm.com Thu Mar 4 08:45:41 1999 michael@0: */ michael@0: michael@0: michael@0: #ifndef _r_time_h michael@0: #define _r_time_h michael@0: michael@0: +#include michael@0: michael@0: -#ifdef WIN32 michael@0: -# include michael@0: -#else michael@0: -/* Cribbed from the autoconf doc */ michael@0: -# if TIME_WITH_SYS_TIME michael@0: -# include michael@0: -# include michael@0: -# else michael@0: -# if HAVE_SYS_TIME_H michael@0: -# include michael@0: -# else michael@0: -# include michael@0: -# endif michael@0: -# endif michael@0: +#ifndef WIN32 michael@0: +#include michael@0: +#include michael@0: #endif michael@0: michael@0: int r_timeval_diff(struct timeval *t1,struct timeval *t0, struct timeval *diff); michael@0: int r_timeval_add(struct timeval *t1,struct timeval *t2, struct timeval *sum); michael@0: int r_timeval_cmp(struct timeval *t1,struct timeval *t2); michael@0: michael@0: UINT8 r_timeval2int(struct timeval *tv); michael@0: int r_int2timeval(UINT8 t,struct timeval *tv); michael@0: UINT8 r_gettimeint(void); michael@0: michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/util/util.c b/media/mtransport/third_party/nrappkit/src/util/util.c michael@0: --- a/media/mtransport/third_party/nrappkit/src/util/util.c michael@0: +++ b/media/mtransport/third_party/nrappkit/src/util/util.c michael@0: @@ -292,20 +292,22 @@ int nr_sha1_file(char *filename,UCHAR *o michael@0: michael@0: return(_status); michael@0: } michael@0: michael@0: #endif michael@0: michael@0: #ifdef WIN32 michael@0: // TODO michael@0: #else michael@0: michael@0: +#if 0 michael@0: + michael@0: #include michael@0: michael@0: int nr_rm_tree(char *path) michael@0: { michael@0: FTS *fts=0; michael@0: FTSENT *p; michael@0: int failed=0; michael@0: int _status; michael@0: char *argv[2]; michael@0: michael@0: @@ -337,20 +339,21 @@ int nr_rm_tree(char *path) michael@0: } michael@0: michael@0: if(failed) michael@0: ABORT(R_FAILED); michael@0: michael@0: _status=0; michael@0: abort: michael@0: if(fts) fts_close(fts); michael@0: return(_status); michael@0: } michael@0: +#endif michael@0: michael@0: int nr_write_pid_file(char *pid_filename) michael@0: { michael@0: FILE *fp; michael@0: int _status; michael@0: michael@0: if(!pid_filename) michael@0: ABORT(R_BAD_ARGS); michael@0: michael@0: unlink(pid_filename); michael@0: @@ -739,12 +742,24 @@ int gettimeofday(struct timeval *tv, voi michael@0: * since the Epoch */ michael@0: SystemTimeToFileTime(&st, &ft); michael@0: u.HighPart = ft.dwHighDateTime; michael@0: u.LowPart = ft.dwLowDateTime; michael@0: michael@0: tv->tv_sec = (long) (u.QuadPart / 10000000L); michael@0: tv->tv_usec = (long) (st.wMilliseconds * 1000);; michael@0: michael@0: return 0; michael@0: } michael@0: + michael@0: +int snprintf(char *buffer, size_t n, const char *format, ...) michael@0: +{ michael@0: + va_list argp; michael@0: + int ret; michael@0: + va_start(argp, format); michael@0: + ret = _vscprintf(format, argp); michael@0: + vsnprintf_s(buffer, n, _TRUNCATE, format, argp); michael@0: + va_end(argp); michael@0: + return ret; michael@0: +} michael@0: + michael@0: #endif michael@0: michael@0: diff --git a/media/mtransport/third_party/nrappkit/src/util/util.h b/media/mtransport/third_party/nrappkit/src/util/util.h michael@0: --- a/media/mtransport/third_party/nrappkit/src/util/util.h michael@0: +++ b/media/mtransport/third_party/nrappkit/src/util/util.h michael@0: @@ -57,12 +57,17 @@ int nr_drop_privileges(char *username); michael@0: int nr_hex_ascii_dump(Data *data); michael@0: int nr_fwrite_all(FILE *fp,UCHAR *buf,int len); michael@0: int nr_sha1_file(char *filename,UCHAR *out); michael@0: int nr_bin2hex(UCHAR *in,int len,UCHAR *out); michael@0: int nr_rm_tree(char *path); michael@0: int nr_write_pid_file(char *pid_filename); michael@0: michael@0: int nr_reg_uint4_fetch_and_check(NR_registry key, UINT4 min, UINT4 max, int log_fac, int die, UINT4 *val); michael@0: int nr_reg_uint8_fetch_and_check(NR_registry key, UINT8 min, UINT8 max, int log_fac, int die, UINT8 *val); michael@0: michael@0: +#ifdef WIN32 michael@0: +int snprintf(char *buffer, size_t n, const char *format, ...); michael@0: +const char *inet_ntop(int af, const void *src, char *dst, size_t size); michael@0: #endif michael@0: michael@0: +#endif michael@0: +