Re: New release of GTK+ libraries (1.3.12)



Gerrit P. Haase writes:
 > > Calls to those *are* already in GLib, I was just indicating that you
 > > do need to stuff from the Win32 API even if building for Cygwin.

 > I meant to add some of the features to Cygwin so I don't need to
 > define WIN32.

Adding the whole locale framework to Cygwin would be a rather big
undertaking, especially if you don't want to just drop in some
existing suitable open source locale code but want it to still reflect
the underlying Windows regional settings. (For instance, if you want
strftime() to use the date formats set in the Control Panel.)

But Cygwin runs on Win32 anyway, so I don't really see the point in
pretending Win32 isn't there and can't be used, for things that aren't
implemented in Cygwin, like locales?

Try the following program on Cygwin:

#include <stdlib.h>
#include <stdio.h>
#include <locale.h>
#include <time.h>

static void
print_all (void)
{
  char buf[100];
  struct tm *tmp;
  time_t t;

#define CATEGORY(x) printf (#x ": %s\n", setlocale (x, NULL));
  CATEGORY (LC_ALL);
  CATEGORY (LC_COLLATE);
  CATEGORY (LC_CTYPE);
#ifdef LC_MESSAGES
  CATEGORY (LC_MESSAGES);
#endif
  CATEGORY (LC_MONETARY);
  CATEGORY (LC_NUMERIC);
  CATEGORY (LC_TIME);
#undef CATEGORY

  time (&t);
  tmp = localtime (&t);
  strftime (buf, sizeof (buf), "%A %B %d %y -- %c", tmp);
  printf ("%s\n", buf);
}

int
main (int    argc,
      char **argv)
{
  print_all ();

  setlocale (LC_ALL, "");
  printf ("After setlocale (LC_ALL, \"\")\n");
  print_all ();

  setlocale (LC_TIME, "Finnish_Finland.1252");
  printf ("After setlocale (LC_TIME, \"Finnish_Finland.1252\")\n");
  print_all ();

  setlocale (LC_ALL, "C");
  printf ("After setlocale (LC_ALL, \"C\")\n");
  print_all ();

  return 0;
}

Then try it with mingw (or MSVC). You will notice Cygwin always says
the locale is "C", while MSVCRT (the Microsoft C library) uses locale
names like "English.United_States.1252", and knows how to separately
set the different categories.

 > I want to build for native Cygwin platform and never define WIN32.

What is a "native Cygwin platform"? Isn't Cygwin by definition a
non-native platform?

 > Now I have also problems going further with `atk', the tools from
 > glib are crashing.

Is it perhaps glib-mkenums that crashes? The file atkobject.h triggers
a crash in the Cygwin Perl. ActiveState's Perl 5.6.1 handles it OK...

--tml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]