[calligra/krita-sketchgl-rempt] krita/plugins/extensions/gmic: Make gmic plugin compile on windows (lolmsvc)

Dan Leinir Turthra Jensen admin at leinir.dk
Fri Sep 20 13:31:28 UTC 2013


It /isn't/ the right way to go, no - we just wanted to get a release out the 
door, without at the same time breaking it all on linux. I'll try and send 
them the patch and see what they say, though.

On Friday 20 September 2013 15:07:31 Lukast dev wrote:
> Well, I'm not sure if this is way to go.
> 
> gmic.cpp is copy of upstream project from http://gmic.sourceforge.net/ and
> I plan to merge it.
> Can you try to commit to upstream project too?
> 
> Long-term goal is to depend on gmic as external package but right now
> no distribution packages gmic.
> 
> Lukas
> 
> 
> 2013/9/20 Dan Leinir Turthra Jensen <admin at leinir.dk>
> 
> > Git commit f70f9394a0c5f108e4d9125d003f1ff6902a5fee by Dan Leinir Turthra
> > Jensen.
> > Committed on 20/09/2013 at 12:11.
> > Pushed by leinir into branch 'krita-sketchgl-rempt'.
> > 
> > Make gmic plugin compile on windows (lolmsvc)
> > 
> > M  +10   -1    krita/plugins/extensions/gmic/gmic.cpp
> > M  +4    -0    krita/plugins/extensions/gmic/gmic.h
> > 
> > http://commits.kde.org/calligra/f70f9394a0c5f108e4d9125d003f1ff6902a5fee
> > 
> > diff --git a/krita/plugins/extensions/gmic/gmic.cpp
> > b/krita/plugins/extensions/gmic/gmic.cpp
> > index 846a141..edb33cd 100644
> > --- a/krita/plugins/extensions/gmic/gmic.cpp
> > +++ b/krita/plugins/extensions/gmic/gmic.cpp
> > @@ -1579,7 +1579,11 @@ CImgList<char>
> > gmic::commands_line_to_CImgList(const char *const commands_line)
> > 
> >  //-------------------------------
> >  gmic& gmic::assign(const char *const custom_commands, const bool
> > 
> > include_default_commands,
> > 
> >                     float *const p_progress, int *const p_cancel) {
> > 
> > +#if defined(_WIN32) || defined(_WIN64)
> > +  setlocale(LC_NUMERIC,"C");
> > +#else
> > 
> >    std::setlocale(LC_NUMERIC,"C");
> > 
> > +#endif
> > 
> >    cimg::srand();
> >    verbosity = 0;
> >    nb_carriages = 0;
> > 
> > @@ -11164,8 +11168,13 @@ gmic& gmic::parse(const CImgList<char>&
> > commands_line, unsigned int& position,
> > 
> >                    _filename0,stype,
> >                    gmic_selection);
> > 
> > +#if defined(_WIN32) || defined(_WIN64)
> > +#define what_strcasecmp _stricmp
> > +#else
> > +#define what_strcasecmp strcasecmp
> > +#endif
> > 
> >  #define gmic_load_raw(value_type,svalue_type) \
> > 
> > -            if (!strcasecmp(stype,svalue_type)) \
> > +            if (!what_strcasecmp(stype,svalue_type)) \
> > 
> >                CImg<value_type>::get_load_raw(filename,(unsigned
> > 
> > int)dx,(unsigned int)dy,\
> > 
> >                                               (unsigned int)dz,(unsigned
> > 
> > int)dc).\
> > 
> >                  move_to(input_images);
> > 
> > diff --git a/krita/plugins/extensions/gmic/gmic.h
> > b/krita/plugins/extensions/gmic/gmic.h
> > index 779a5bf..6103fb6 100644
> > --- a/krita/plugins/extensions/gmic/gmic.h
> > +++ b/krita/plugins/extensions/gmic/gmic.h
> > @@ -297,7 +297,11 @@ struct gmic {
> > 
> >               gmic_list<T> &images, gmic_list<char> &images_names) {
> >      
> >      const unsigned int variables_sizes[256] = { 0 };
> >      unsigned int position = 0;
> > 
> > +#if defined(_WIN32) || defined(_WIN64)
> > +    setlocale(LC_NUMERIC,"C");
> > +#else
> > 
> >      std::setlocale(LC_NUMERIC,"C");
> > 
> > +#endif
> > 
> >      scope.assign(1U);
> >      scope._data[0].assign(2,1,1,1);
> >      scope._data[0]._data[0] = '.';
-- 
..Dan // Leinir..
http://leinir.dk/

                          Co-
                            existence
                          or no
                            existence

                          - Piet Hein


More information about the kimageshop mailing list