Bug 118407

Summary: dcrawprocess.cpp does not compileon Solaris
Product: [Applications] digikam Reporter: Aaron Williams <aaronw>
Component: Portability-CompilationAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Solaris   
Latest Commit: Version Fixed In: 0.1.0

Description Aaron Williams 2005-12-15 22:02:34 UTC
Version:           0.1.0-rc1 (using KDE KDE 3.5.0)
Installed from:    Compiled From Sources
Compiler:          gcc version 3.3.6
OS:                SunOS (sun4u) release 5.8

dcrawprocess.cpp attempts to include getopt.h.  On Solaris, getopt is defined in stdlib.h according to the man page.

#ifdef USE_SOLARIS
#include <stdlib.h>
#else
#include <getopt.h>
#endif
Comment 1 Thiago Macieira 2005-12-16 03:06:18 UTC
According to the man pages available through Google, it's unistd.h for Linux, NetBSD, OpenBSD, FreeBSD, HP-UX but it's stdlib.h for BSD 4.3 & Solaris. (Can't find for IRIX an AIX)

getopt.h is only needed for getopt_long.
Comment 2 Thiago Macieira 2005-12-16 03:11:41 UTC
SVN commit 488831 by thiago:

* Remove getopt.h from the includes: it's only needed for getopt_long, which
  isn't used here.
* Add stdlib.h because Solaris has getopt there instead of unistd.h (which
  sounds like the correct place to be, since getopt isn't part of ISO C).
* Move sys/types.h to the top, just to be on the safe side.

BUG:118407


 M  +2 -2      dcrawprocess.cpp  


--- trunk/extragear/libs/kipi-plugins/rawconverter/dcrawprocess.cpp #488830:488831
@@ -25,12 +25,12 @@
 
 extern "C"
 {
+#include <sys/types.h>
 #include <stdio.h>
 #include <unistd.h>
-#include <sys/types.h>
+#include <stdlib.h>
 #include <sys/wait.h>
 #include <signal.h>
-#include <getopt.h>
 #include <jpeglib.h>
 #include <tiffio.h>
 }