View Issue Details

IDProjectCategoryView StatusLast Update
0002194ScribusInternalpublic2005-07-06 04:42
Reporterjghali Assigned Toringerc 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindowsOS Version2000 SP4
Product Version1.3.0cvs 
Fixed in Version1.3.0cvs 
Summary0002194: Use unistd header only if available
DescriptionUnistd header should be included only if available (ie HAVE_DLFCN_H is defined). The attached diff resolve that portability issue. Additionnaly it remove an unuseful #include <dlfcn.h> in gtgettext.h. getgettext use qlibrary for some time indeed.
TagsNo tags attached.
Patch

Relationships

child of 0000015 closedjghali Windows Port 

Activities

2005-07-05 14:22

 

unistd_if_available.diff (3,920 bytes)   
cvs -Q diff -u (in directory E:\Scribus For Windows\scribus-1.3.x-cvs\Scribus\)
cvs diff: Empty password used - try 'cvs login' with a real password

Index: scribus/fileunzip.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/fileunzip.cpp,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 fileunzip.cpp
--- scribus/fileunzip.cpp	1 Jul 2005 16:51:38 -0000	1.1.2.3
+++ scribus/fileunzip.cpp	5 Jul 2005 15:57:23 -0000
@@ -32,7 +32,10 @@
 #include <sys/stat.h>
 #endif
 
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
+#endif
+
 # include <utime.h>
 
 #include <iostream>
Index: scribus/filewatcher.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/filewatcher.cpp,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 filewatcher.cpp
--- scribus/filewatcher.cpp	13 Jan 2005 22:07:11 -0000	1.1.2.3
+++ scribus/filewatcher.cpp	5 Jul 2005 15:57:23 -0000
@@ -1,6 +1,11 @@
 #include "filewatcher.h"
 #include "filewatcher.moc"
+
+#include "scconfig.h"
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 FileWatcher::FileWatcher( QWidget* parent) : QObject(parent)
 {
Index: scribus/gtgettext.h
===================================================================
RCS file: /cvs/Scribus/scribus/gtgettext.h,v
retrieving revision 1.2.2.7
diff -u -r1.2.2.7 gtgettext.h
--- scribus/gtgettext.h	5 Jul 2005 06:36:03 -0000	1.2.2.7
+++ scribus/gtgettext.h	5 Jul 2005 16:02:57 -0000
@@ -21,7 +21,6 @@
 #ifndef GTGETTEXT_H
 #define GTGETTEXT_H
 
-#include <dlfcn.h>
 #include <iostream>
 #include <vector>
 
Index: scribus/scimage.h
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/scimage.h,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 scimage.h
--- scribus/scimage.h	5 Jul 2005 06:36:03 -0000	1.1.2.12
+++ scribus/scimage.h	5 Jul 2005 15:57:23 -0000
@@ -6,7 +6,9 @@
 #include <setjmp.h>
 #include <cstdlib>
 #include <cmath>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <valarray>
 #include <qimage.h>
 #include <qstring.h>
Index: scribus/scribusview.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribusview.cpp,v
retrieving revision 1.76.2.231
diff -u -r1.76.2.231 scribusview.cpp
--- scribus/scribusview.cpp	5 Jul 2005 06:36:03 -0000	1.76.2.231
+++ scribus/scribusview.cpp	5 Jul 2005 16:09:18 -0000
@@ -34,7 +34,11 @@
 #include <cmath>
 #include <cstdio>
 #include <cstdlib>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+
 #include <qcursor.h>
 #include <qurl.h>
 #include <qdir.h>
Index: scribus/util.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/util.cpp,v
retrieving revision 1.52.2.93
diff -u -r1.52.2.93 util.cpp
--- scribus/util.cpp	5 Jul 2005 06:36:03 -0000	1.52.2.93
+++ scribus/util.cpp	5 Jul 2005 16:06:09 -0000
@@ -28,7 +28,13 @@
 #include <algorithm>
 #include <cstdlib>
 #include <cmath>
+
+#include "scconfig.h"
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+
 #include "md5.h"
 #include <setjmp.h>
 #include "qprocess.h"
@@ -37,8 +43,6 @@
 #include "prefscontext.h"
 #include "prefstable.h"
 
-#include "scconfig.h"
-
 extern PrefsFile *prefsFile;
 
 extern "C"
Index: scribus/libpdf/pdflib.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/libpdf/pdflib.cpp,v
retrieving revision 1.78.2.109
diff -u -r1.78.2.109 pdflib.cpp
--- scribus/libpdf/pdflib.cpp	5 Jul 2005 06:36:03 -0000	1.78.2.109
+++ scribus/libpdf/pdflib.cpp	5 Jul 2005 15:57:23 -0000
@@ -30,7 +30,9 @@
 #include <qdir.h>
 #include <cstdlib>
 #include <cmath>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include "rc4.h"
 
 #include "pageitem.h"
unistd_if_available.diff (3,920 bytes)   

ringerc

2005-07-05 14:46

reporter   ~0005397

Looks sensible to me.

I should convert gt* to use the loader abstraction you wrote, actually. That way we'll get better error reporting (we can use dlerror()) if nothing else.

Issue History

Date Modified Username Field Change
2005-07-05 14:22 jghali New Issue
2005-07-05 14:22 jghali File Added: unistd_if_available.diff
2005-07-05 14:26 ringerc Status new => assigned
2005-07-05 14:26 ringerc Assigned To => ringerc
2005-07-05 14:46 ringerc Status assigned => resolved
2005-07-05 14:46 ringerc Resolution open => fixed
2005-07-05 14:46 ringerc Note Added: 0005397
2005-07-05 17:55 cbradney Status resolved => closed
2005-07-05 17:55 cbradney Fixed in Version => 1.3.0cvs
2005-07-06 04:42 ringerc Relationship added child of 0000015