--- nbase/nbase.h
+++ nbase/nbase.h
@@ -93,8 +93,12 @@
  *
  * * Various Windows -> UNIX compatibility definitions are added (such as defining EMSGSIZE to WSAEMSGSIZE)
  */
 
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
+
 #if HAVE_CONFIG_H
 #include "nbase_config.h"
 #else
 #ifdef WIN32
--- MACLookup.cc
+++ MACLookup.cc
@@ -158,7 +158,7 @@ static void mac_prefix_init() {
     std::pair<MacMap::iterator, bool> status = MacTable.insert(std::pair<u64, const char *>(pfx, string_pool_substr(vendor, endptr)));
 
     if (!status.second && o.debugging > 1)
-      error("MAC prefix %0*" PRIX64 " is duplicated in %s; ignoring duplicates.", (int)(pfx >> 36), pfx & 0xfffffffffL, filename);
+      error("MAC prefix %0*" PRIX64 " is duplicated in %s; ignoring duplicates.", (int)(pfx >> 36), pfx & 0xfffffffffLL, filename);
   }
 
   fclose(fp);
