Index: /branches/binary/server/memcached.c
===================================================================
--- /branches/binary/server/memcached.c (revision 763)
+++ /branches/binary/server/memcached.c (revision 766)
@@ -61,4 +61,8 @@
 #endif
 
+#ifndef HAVE_DAEMON
+extern int daemon(int nochdir, int noclose);
+#endif
+
 /*
  * forward declarations
@@ -882,5 +886,5 @@
     res_header = (uint32_t *)c->wbuf;
 
-    res_header[0] = BIN_RES_MAGIC << 24;
+    res_header[0] = ((uint32_t)BIN_RES_MAGIC) << 24;
     res_header[0] |= ((0xff & c->cmd) << 16);
     res_header[0] |= err & 0xffff;
Index: /branches/binary/server/thread.c
===================================================================
--- /branches/binary/server/thread.c (revision 745)
+++ /branches/binary/server/thread.c (revision 766)
@@ -368,6 +368,6 @@
  * of an incoming connection.
  */
-void dispatch_conn_new(int sfd, int init_state, int event_flags,
-                       int read_buffer_size, int prot) {
+void dispatch_conn_new(int sfd, enum conn_states init_state, int event_flags,
+                       int read_buffer_size, enum protocol prot) {
     CQ_ITEM *item = cqi_new();
     int thread = (last_thread + 1) % settings.num_threads;
