Bug 89577 - kdebase fails compilation on DragonFlyBSD because of a wrong #include
Summary: kdebase fails compilation on DragonFlyBSD because of a wrong #include
Status: RESOLVED FIXED
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: FreeBSD Ports Other
: NOR normal
Target Milestone: ---
Assignee: andy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-15 16:30 UTC by Emiel Kollof
Modified: 2005-06-11 13:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emiel Kollof 2004-09-15 16:30:20 UTC
Version:           3.3.0 (using KDE KDE 3.3.0)
Installed from:    FreeBSD Ports
Compiler:          gcc 2.95.3 
OS:                Other

kio_ldap.cpp in $(kdebasesrc)/kioslave/ldap/ fails compination because it includes <netinet/in.h> to het ntohl(), but needs to use <sys/param.h> on DragonFlyBSD (and maybe others).

See bug http://bugs.kde.org/show_bug.cgi?id=89544 for a solution
Comment 1 Szombathelyi György 2004-09-17 11:50:40 UTC
There was a commit by Andy Fawcett to kio_ldap which added <netinet/in.h>
http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdebase/kioslave/ldap/kio_ldap.cpp.diff?r1=1.37&r2=1.38

Is it ok to change this to <arpa/inet.h>?
Comment 2 andy 2004-09-17 23:40:19 UTC
using <arpa/inet.h> instead seems to compile fine on both FreeBSD 4.x and 5.x, so if that is okay for DragonflyBSD I don't object to the change.

Emiel, can you check that on DF for me please? I'll commit the fix to HEAD and BRANCH if it works for you.
Comment 3 Emiel Kollof 2004-09-18 02:57:09 UTC
Both <sys/param.h> and <arpa/inet.h> work fine for me.
Comment 4 Emiel Kollof 2004-09-18 03:00:33 UTC
Oh, there are other places (kdegames/kdenetwork/kdepim, I might be forgetting one or two) that also use netinet/in.h to get htonl() and friends. Might be prudent to grep -rn for netinet/in.h in your source base.

Oh, and since arpa/inet.,h seems to work for all of us, you can go ahead and commit that :)
Comment 5 andy 2004-09-21 13:13:26 UTC
Committing this fix. I don't have the time to go through all the modules at the moment, but if you mail me the filenames as you come across them I'll do my best
Comment 6 andy 2004-09-21 13:13:53 UTC
CVS commit by fawcett: 

Fix include so that it builds on DragonflyBSD too

Will forward port later.

CCMAIL: 89577-done@bugs.kde.org


  M +2 -1      kio_ldap.cpp   1.41.2.3


--- kdebase/kioslave/ldap/kio_ldap.cpp  #1.41.2.2:1.41.2.3
@@ -16,5 +16,6 @@
 #include <stdlib.h>
 #include <netdb.h>
-#include <netinet/in.h>
+//#include <netinet/in.h>
+#include <arpa/inet.h>
 
 #include <kdebug.h>


Comment 7 Nicolas Goutte 2005-06-11 13:02:43 UTC
Note: this fix has been reversed in the meantime.