Summary: | kdebase-3.3.92/kcontrol/kfontinst/kfontinst/GetPid.c doesn't compile on Solaris 2.6 - incorrect kfi_getPid prototype | ||
---|---|---|---|
Product: | kcontrol | Reporter: | Steve Evans <stevee> |
Component: | kcmfontinst | Assignee: | Craig Drummond <craig> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Solaris | ||
Latest Commit: | Version Fixed In: |
Description
Steve Evans
2005-02-14 10:53:43 UTC
>
> which doesn't match the prototype.
Does it work if you remove the prototype?
Craig.
Yes, but a better solution is to provide a platform specific prototype, like this: #if defined OS_Irix || defined OS_Solaris unsigned int kfi_getPid(const char *proc, pid_t ppid); #else unsigned int kfi_getPid(const char *proc, unsigned int ppid); #endif OK. Well the prototype in GetPid.c is not required - not sure why I put it there... But there's an "extern kfi_getPid(...)" in XConfig.cpp that should use the platform specific prototype you mentioned above. I will make this change as soon as I can. Thanks for spotting this, and the other bug - which I'll look into later. Can you confirm that the latest GetPid.c and XConfig.cpp in CVS... http://webcvs.kde.org/*checkout*/kdebase/kcontrol/kfontinst/kfontinst/GetPid.c?rev=1.2 http://webcvs.kde.org/*checkout*/kdebase/kcontrol/kfontinst/kfontinst/XConfig.cpp?rev=1.23 ...fix the problem? If so I'll close the bug report. Yes, those files fix the problem. Thanks. *** Bug has been marked as fixed ***. Using snapshot 050222 which includes both files still fails to compile here: uname -a SunOS sunray 5.9 Generic_117171-14 sun4u sparc SUNW,Sun-Fire-880 Solaris if gcc -DHAVE_CONFIG_H -I. -I. -I../../.. -DOS_Solaris -I./../lib -I./../../fonts -I/usr/local/KDE-3.4.0_CVS/include -I/usr/local/qt-050201/include -I/usr/local2/lude/soft/freetype-2.1.9/run/default/sparc_sun_solaris2.9/include/freetype2 -I/usr/local2/lude/soft/freetype-2.1.9/run/default/sparc_sun_solaris2.9/include -I/usr/local2/lude/soft/fontconfig-2.2.2/run/default/sparc_sun_solaris2.9/include -DQT_THREAD_SUPPORT -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4 -D_FILE_OFFSET_BITS=64 -DNDEBUG -O2 -D_GNU_SOURCE -MT GetPid.o -MD -MP -MF ".deps/GetPid.Tpo"\ -c -o GetPid.o `test -f 'GetPid.c' || echo './'`GetPid.c; \ then mv -f ".deps/GetPid.Tpo" ".deps/GetPid.Po"; \ else rm -f ".deps/GetPid.Tpo"; exit 1; \ fi In file included from /usr/include/procfs.h:26, from GetPid.c:246: /usr/include/sys/procfs.h:44:2: #error "Cannot use procfs in the large file compilation environment" make[4]: *** [GetPid.o] Error 1 Using this patch on top of your files works, the patch is described here: http://article.gmane.org/gmane.comp.kde.solaris/2089 --- ./kdebase/kcontrol/kfontinst/kfontinst/GetPid.c 2004-11-12 23:42:24.000000000 +0100 +++ ./kdebase/kcontrol/kfontinst/kfontinst/GetPid.c 2005-02-16 13:47:53.894184000 +0100 @@ -245,7 +249,19 @@ #include <pwd.h> #include <sys/resource.h> #ifdef OS_Solaris +#if (!defined(_LP64)) && (_FILE_OFFSET_BITS - 0 == 64) +#define PROCFS_FILE_OFFSET_BITS_HACK 1 +#undef _FILE_OFFSET_BITS +#else +#define PROCFS_FILE_OFFSET_BITS_HACK 0 +#endif + #include <procfs.h> + +#if (PROCFS_FILE_OFFSET_BITS_HACK - 0 == 1) +#define _FILE_OFFSET_BITS 64 +#endif + #else #include <sys/procfs.h> #include <sys/sysmp.h> Ah yes, I get that on solaris 2.6 as well. I had forgotten about it because I worked around it by changing -D_FILE_OFFSET_BITS=64 in the Makefile to 32. I then forgot to report a bug about it :-( Hi, Thanks for this - I've applied the patch. Can you get Version 1.3 of GetPid.c, and check that everything is OK now. Once again, thanks for your help. Craig. File isn't in webCVS atm, will try tomorrow. http://webcvs.kde.org//kdebase/kcontrol/kfontinst/kfontinst/GetPid.c Unfortunately version 1.3 did not make it into 3.4.0rc1 Ok, correct file is in snapshot 050302 now, thanks! |