about summary refs log tree commit diff
path: root/converter/other/cameratopam
diff options
context:
space:
mode:
Diffstat (limited to 'converter/other/cameratopam')
-rw-r--r--converter/other/cameratopam/Makefile7
-rw-r--r--converter/other/cameratopam/cameratopam.c22
2 files changed, 7 insertions, 22 deletions
diff --git a/converter/other/cameratopam/Makefile b/converter/other/cameratopam/Makefile
index b6778c67..20a95aa2 100644
--- a/converter/other/cameratopam/Makefile
+++ b/converter/other/cameratopam/Makefile
@@ -5,14 +5,15 @@ endif
 SUBDIR = converter/other/cameratopam
 VPATH=.:$(SRCDIR)/$(SUBDIR)
 
+EXTERN_INCLUDES =
 ifneq ($(JPEGLIB),NONE)
   ifneq ($(JPEGHDR_DIR)x,x)
-    INCLUDES += -I$(JPEGHDR_DIR)
+    EXTERN_INCLUDES += -I$(JPEGHDR_DIR)
     CFLAGS += -DHAVE_JPEG
   endif
 endif
 
-include $(BUILDDIR)/Makefile.config
+include $(BUILDDIR)/config.mk
 
 
 .PHONY: all
@@ -27,7 +28,7 @@ BINARIES = cameratopam
 MERGEBINARIES = 
 SCRIPTS = 
 
-include $(SRCDIR)/Makefile.common
+include $(SRCDIR)/common.mk
 
 cameratopam: $(OBJECTS) $(NETPBMLIB) $(LIBOPT)
 	$(LD) -o $@ \
diff --git a/converter/other/cameratopam/cameratopam.c b/converter/other/cameratopam/cameratopam.c
index 92773c91..b2d6da9b 100644
--- a/converter/other/cameratopam/cameratopam.c
+++ b/converter/other/cameratopam/cameratopam.c
@@ -24,18 +24,13 @@
 #include <string.h>
 
 #ifdef __CYGWIN__
-#include <io.h>
+  #include <io.h>
 #endif
-#ifdef WIN32
-  #include <winsock2.h>
-  #pragma comment(lib, "ws2_32.lib")
-  #define strcasecmp stricmp
-  typedef __int64 INT64;
-  static bool const have64BitArithmetic = true;
-#else
+#if !defined(WIN32) || defined(__CYGWIN__)
   #include <unistd.h>
 #endif
 
+#include "pm_c_util.h"
 #include "mallocvar.h"
 #include "shhopt.h"
 #include "pam.h"
@@ -48,17 +43,6 @@
 #include "foveon.h"
 #include "dng.h"
 
-#if HAVE_INT64
-   typedef int64_t INT64;
-   static bool const have64BitArithmetic = true;
-#else
-   /* We define INT64 to something that lets the code compile, but we
-      should not execute any INT64 code, because it will get the wrong
-      result.  */
-   typedef int INT64;
-   static bool const have64BitArithmetic = false;
-#endif
-
 /*
    All global variables are defined here, and all functions that
    access them are prefixed with "CLASS".  Note that a thread-safe