diff -ruN live/BasicUsageEnvironment/BasicHashTable.cpp live.new/BasicUsageEnvironment/BasicHashTable.cpp
--- live/BasicUsageEnvironment/BasicHashTable.cpp	2009-07-28 03:05:14.000000000 +0200
+++ live.new/BasicUsageEnvironment/BasicHashTable.cpp	2009-08-19 00:58:32.000000000 +0200
@@ -26,6 +26,7 @@
 #endif
 #include <string.h>
 #include <stdio.h>
+#include <stdint.h>
 
 // When there are this many entries per bucket, on average, rebuild
 // the table to increase the number of buckets
@@ -253,17 +254,17 @@
 }
 
 unsigned BasicHashTable::hashIndexFromKey(char const* key) const {
-  unsigned result = 0;
+  uintptr_t result = 0;
 
   if (fKeyType == STRING_HASH_KEYS) {
     while (1) {
       char c = *key++;
       if (c == 0) break;
-      result += (result<<3) + (unsigned)c;
+      result += (result<<3) + (uintptr_t)c;
     }
     result &= fMask;
   } else if (fKeyType == ONE_WORD_HASH_KEYS) {
-    result = randomIndex((unsigned long)key);
+    result = randomIndex((uintptr_t)key);
   } else {
     unsigned* k = (unsigned*)key;
     unsigned long sum = 0;
diff -ruN live/BasicUsageEnvironment/BasicTaskScheduler0.cpp live.new/BasicUsageEnvironment/BasicTaskScheduler0.cpp
--- live/BasicUsageEnvironment/BasicTaskScheduler0.cpp	2009-07-28 03:05:14.000000000 +0200
+++ live.new/BasicUsageEnvironment/BasicTaskScheduler0.cpp	2009-08-19 00:58:04.000000000 +0200
@@ -19,6 +19,7 @@
 
 #include "BasicUsageEnvironment0.hh"
 #include "HandlerSet.hh"
+#include <stdint.h>
 
 ////////// A subclass of DelayQueueEntry,
 //////////     used to implement BasicTaskScheduler0::scheduleDelayedTask()
@@ -64,7 +65,7 @@
 }
 
 void BasicTaskScheduler0::unscheduleDelayedTask(TaskToken& prevTask) {
-  DelayQueueEntry* alarmHandler = fDelayQueue.removeEntry((long)prevTask);
+  DelayQueueEntry* alarmHandler = fDelayQueue.removeEntry((intptr_t)prevTask);
   prevTask = NULL;
   delete alarmHandler;
 }
diff -ruN live/groupsock/Groupsock.cpp live.new/groupsock/Groupsock.cpp
--- live/groupsock/Groupsock.cpp	2009-07-28 03:05:14.000000000 +0200
+++ live.new/groupsock/Groupsock.cpp	2009-08-19 00:57:14.000000000 +0200
@@ -17,6 +17,7 @@
 // 'Group sockets'
 // Implementation
 
+#include <stdint.h>
 #include "Groupsock.hh"
 #include "GroupsockHelper.hh"
 //##### Eventually fix the following #include; we shouldn't know about tunnels
@@ -403,7 +404,7 @@
 	= (TunnelEncapsulationTrailer*)&data[size];
       TunnelEncapsulationTrailer* trailer;
 
-      Boolean misaligned = ((unsigned long)trailerInPacket & 3) != 0;
+      Boolean misaligned = ((uintptr_t)trailerInPacket & 3) != 0;
       unsigned trailerOffset;
       u_int8_t tunnelCmd;
       if (isSSM()) {
diff -ruN live/liveMedia/MP3StreamState.cpp live.new/liveMedia/MP3StreamState.cpp
--- live/liveMedia/MP3StreamState.cpp	2009-07-28 03:05:14.000000000 +0200
+++ live.new/liveMedia/MP3StreamState.cpp	2009-08-19 00:56:37.000000000 +0200
@@ -20,6 +20,7 @@
 
 #include "MP3StreamState.hh"
 #include "GroupsockHelper.hh"
+#include <stdint.h>
 
 #if defined(__WIN32__) || defined(_WIN32)
 #define snprintf _snprintf
@@ -35,8 +36,8 @@
   // Close our open file or socket:
   if (fFid != NULL && fFid != stdin) {
     if (fFidIsReallyASocket) {
-      long fid_long = (long)fFid;
-      closeSocket((int)fid_long);
+      intptr_t fid_long = (intptr_t)fFid;
+      closeSocket((int)(intptr_t)fid_long);
     } else {
       fclose(fFid);
     }
@@ -201,8 +202,8 @@
   char const* const getCmdFmt = "GET %s HTTP/1.1\r\nHost: %s:%d\r\n\r\n";
 
   if (fFidIsReallyASocket) {
-    long fid_long = (long)fFid;
-    int sock = (int)fid_long;
+    intptr_t fid_long = (intptr_t)fFid;
+    int sock = (int)(intptr_t)fid_long;
     char writeBuf[100];
 #if defined(IRIX) || defined(ALPHA) || defined(_QNX4) || defined(IMN_PIM) || defined(CRIS)
     /* snprintf() isn't defined, so just use sprintf() */
@@ -412,8 +413,8 @@
 					unsigned numChars) {
   // Hack for doing socket I/O instead of file I/O (e.g., on Windows)
   if (fFidIsReallyASocket) {
-    long fid_long = (long)fFid;
-    int sock = (int)fid_long;
+    intptr_t fid_long = (intptr_t)fFid;
+    int sock = (int)(intptr_t)fid_long;
     unsigned totBytesRead = 0;
     do {
       waitUntilSocketIsReadable(fEnv, sock);
diff -ruN live/liveMedia/RTCP.cpp live.new/liveMedia/RTCP.cpp
--- live/liveMedia/RTCP.cpp	2009-07-28 03:05:14.000000000 +0200
+++ live.new/liveMedia/RTCP.cpp	2009-08-19 00:57:01.000000000 +0200
@@ -18,6 +18,7 @@
 // RTCP
 // Implementation
 
+#include <stdint.h>
 #include "RTCP.hh"
 #include "GroupsockHelper.hh"
 #include "rtcp_from_spec.h"
@@ -81,14 +82,14 @@
 
     HashTable::Iterator* iter
       = HashTable::Iterator::create(*fTable);
-    unsigned long timeCount;
+    uintptr_t timeCount;
     char const* key;
-    while ((timeCount = (unsigned long)(iter->next(key))) != 0) {
+    while ((timeCount = (uintptr_t)(iter->next(key))) != 0) {
 #ifdef DEBUG
       fprintf(stderr, "reap: checking SSRC 0x%lx: %ld (threshold %d)\n", (unsigned long)key, timeCount, threshold);
 #endif
-      if (timeCount < (unsigned long)threshold) { // this SSRC is old
-        unsigned long ssrc = (unsigned long)key;
+      if (timeCount < (uintptr_t)threshold) { // this SSRC is old
+        intptr_t ssrc = (uintptr_t)key;
         oldSSRC = (unsigned)ssrc;
         foundOldMember = True;
       }
--- live/BasicUsageEnvironment/include/BasicHashTable.hh	2009-07-28 03:05:14.000000000 +0200
+++ live.new/BasicUsageEnvironment/include/BasicHashTable.hh	2009-08-19 19:00:05.000000000 +0200
@@ -24,6 +24,8 @@
 #include "HashTable.hh"
 #endif
 
+#include <stdint.h>
+
 // A simple hash table implementation, inspired by the hash table
 // implementation used in Tcl 7.6: <http://www.tcl.tk/>
 
@@ -87,7 +89,7 @@
   unsigned hashIndexFromKey(char const* key) const;
     // used to implement many of the routines above
 
-  unsigned randomIndex(unsigned long i) const {
+  unsigned randomIndex(uintptr_t i) const {
     return (((i*1103515245) >> fDownShift) & fMask);
   }
 
diff -ruN live/groupsock/include/NetCommon.h live.new/groupsock/include/NetCommon.h
--- live/groupsock/include/NetCommon.h	2009-07-28 03:05:14.000000000 +0200
+++ live.new/groupsock/include/NetCommon.h	2009-08-19 19:00:59.000000000 +0200
@@ -37,8 +37,12 @@
 #define closeSocket closesocket
 #define EWOULDBLOCK WSAEWOULDBLOCK
 #define EINPROGRESS WSAEWOULDBLOCK
-#define EAGAIN WSAEWOULDBLOCK
-#define EINTR WSAEINTR
+#ifndef EAGAIN
+ #define EAGAIN WSAEWOULDBLOCK
+#endif
+#ifndef EINTR
+ #define EINTR WSAEINTR
+#endif
 
 #if defined(_WIN32_WCE)
 #define NO_STRSTREAM 1
