Bug 118407 - dcrawprocess.cpp does not compileon Solaris
Summary: dcrawprocess.cpp does not compileon Solaris
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Compilation (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-15 22:02 UTC by Aaron Williams
Modified: 2018-03-23 21:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.1.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>
 }