Summary: | KPilot doesn't compile because of wrong SysInfo struct | ||
---|---|---|---|
Product: | [Applications] kpilot | Reporter: | Thomas Vollmer <thomas-ml> |
Component: | General | Assignee: | groot |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Thomas Vollmer
2003-06-02 11:24:31 UTC
Subject: Re: New: KPilot doesn't compile because of wrong SysInfo
struct
On 2 Jun 2003, Thomas Vollmer wrote:
> pilotSysInfo.h:62: `struct SysInfo' has no member named `prodID'
> pilotSysInfo.h: In member function `void KPilotSysInfo::setProductID(char*)':
Which pilot-link version are you using? My version (0.11.7) certainly does
have the fields, so perhaps we've forgotten about backwards compatibility
with older pilot-link versions.
Subject: Re: Well, it is 0.9.5. This is the original package delivered by SuSE for their 8.1 professional distribution. Thomas Vollmer Subject: Re: KPilot doesn't compile because of wrong SysInfo struct Yes, pilot-link 0.9.5 doesn't have prodID and prodIDlength, but they have name and nameLength. I added a #if check to the code and use the appropriate code depending on the pilot-link version. This should fix the bug (but I don't have a system with pilot-link 0.9.x installed, so I'm just hoping that it compiles...). Can you please check if it compiles now? Thanks, Reinhold -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+2zXpTqjEwhXvPN0RAt34AKCQHdCAR5LmT+7F3fQJvRcrUAIJtwCeL8Y9 bsuYyL8Zkvqh67Y27IdgCy8= =VnJO -----END PGP SIGNATURE----- Subject: kdepim/kpilot/lib CVS commit by kainhofe: Argh, why does pilot-link change their API with every version??? CCMAIL: 59247-done@bugs.kde.org M +23 -2 pilotSysInfo.h 1.2 --- kdepim/kpilot/lib/pilotSysInfo.h #1.1:1.2 @@ -33,7 +33,6 @@ #include <time.h> -#ifndef _PILOT_DLP_H_ #include <pi-dlp.h> -#endif +#include <pi-version.h> class KPilotSysInfo @@ -59,4 +58,24 @@ public: void setLocale(unsigned long newval) {fSysInfo.locale=newval;} +#if (PILOT_LINK_VERSION * 1000 + PILOT_LINK_MAJOR * 10 + PILOT_LINK_MINOR) < 100 +// Older pilot-link versions < 0.11.x don't have prodID, but name instead, +// and they also do not have the *Version members. + const int getProductIDLength() const { return fSysInfo.nameLength; } + const char* getProductID() const { return fSysInfo.name; } + void setProductID(char* prodid) + { + ::memset(&fSysInfo.name, 0, sizeof(fSysInfo.name)); + ::strncpy(fSysInfo.name, prodid, sizeof(fSysInfo.name)-1); + boundsCheck(); + fSysInfo.nameLength = ::strlen(fSysInfo.name); + } + + const unsigned short getMajorVersion() const {return 0;} + const unsigned short getMinorVersion() const {return 0;} + const unsigned short getCompatMajorVersion() const {return 0;} + const unsigned short getCompatMinorVersion() const {return 0;} + const unsigned short getMaxRecSize() const {return 0;} +#else +// Newer pilot-link versions have these fields, so use them: const int getProductIDLength() const { return fSysInfo.prodIDLength; } const char* getProductID() const { return fSysInfo.prodID; } @@ -74,4 +93,6 @@ public: const unsigned short getCompatMinorVersion() const {return fSysInfo.compatMinorVersion;} const unsigned short getMaxRecSize() const {return fSysInfo.maxRecSize;} +#endif + private: struct SysInfo fSysInfo; Subject: Re: It is good now (or with other words it compiles now). If it's not perfect I reopen the bug ;-) |