Problem with isspace due to ctype.h
Jaroslaw Staniek
staniek at kde.org
Wed Feb 29 16:15:58 UTC 2012
On 29 February 2012 13:33, Ananta Palani <anantapalani at gmail.com> wrote:
> On Wed, Feb 29, 2012 at 10:57 AM, Jaroslaw Staniek <staniek at kde.org> wrote:
>>
>> On 29 February 2012 11:49, Ananta Palani <anantapalani at gmail.com> wrote:
>> > Hi Jaroslaw,
>> >
>> > [..] I'd rather understand why the replacement was
>> > needed in the first place. Was there a defect with the MSVC
>> > implementation
>> > of isspace?
>>
>> Yes that was the case. This also applies to other functions fixed with
>> KDE_* alternative.
>
>
> Is there any chance that these have been fixed in new versions of MSVC? How
> often are these fixes reviewed?
I did not check this so someone may want to check if the new behaviour
is more standards-compliant.
As long as incompatible MSVC version(s) are supported we cannot drop
the workaround easily.
>> > Also, If I do define KDEWIN_CTYPE_H when building digikam or
>> > other KDE based apps, how do I know when I will need the KDE_isspace
>> > function and when it is safe to exclude it?
>>
>> You can define it in specific places where you meed it. This can be a
>> CMakeLists.txt file or even a .cpp file where you use boost. I
>> remember I have used this approach somewhere.
>
>
> I added it to the .cpp file, but I encountered an error stating that it
> couldn't find any of the ctype functions. So, I did the following:
>
> #ifdef _MSC_VER
> #ifndef KDEWIN_CTYPE_H
> #define KDEWIN_CTYPE_H
> #ifndef _WIN32_WCE
> #include <../include/ctype.h>
> #else
> #include <../wcecompat/ctype.h>
> #endif // _WIN32_WCE
> #endif // KDEWIN_CTYPE_H
> #endif // _MSC_VER
>
> The ctype.h file that kdewin supplies also does the following:
>
> // include everywhere
> #include <sys/types.h>
>
> Should I add this as well? Or why not?
No idea...
--
regards / pozdrawiam, Jaroslaw Staniek
http://www.linkedin.com/in/jstaniek
Kexi & Calligra (kexi-project.org, identi.ca/kexi, calligra-suite.org)
KDE Software Development Platform on MS Windows (windows.kde.org)
More information about the Kde-windows
mailing list