[Vala] Vala HEAD is broken on MacOSX



Hi,

I just tried to compile HEAD from git and it is broken on MacOSX.

Here is the error:

  CCLD   libvala-0.12.la
Undefined symbols:
  "_strnlen", referenced from:
      _string_substring in valaccodebasemodule.o
      _string_substring in valaccodemethodmodule.o
      _string_substring in valadovabasemodule.o
      _string_substring in valagirwriter.o
      _vala_attribute_get_string in libvalacore.a(valaattribute.o)
      _string_substring in libvalacore.a(valaclass.o)
      _string_substring in libvalacore.a(valacodecontext.o)
      _string_substring in libvalacore.a(valagirparser.o)
      _string_substring in libvalacore.a(valagenieparser.o)
      _string_substring in libvalacore.a(valageniescanner.o)
      _string_substring in libvalacore.a(valaintegerliteral.o)
      _string_substring in libvalacore.a(valainterface.o)
      _string_substring in libvalacore.a(valamarkupreader.o)
      _string_substring in libvalacore.a(valamethod.o)
      _string_substring in libvalacore.a(valaparser.o)
      _string_substring in libvalacore.a(valascanner.o)
      _string_substring in libvalacore.a(valasourcefile.o)
      _vala_string_literal_eval in libvalacore.a(valastringliteral.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status


The reason is that strnlen is not defined on macosx (at least on
10.6.4 + xcode 3). The easiest way is to implement it on this platform
as

size_t strnlen(const char *s, size_t n)
{
  const char *p = (const char *)memchr(s, 0, n);
  return(p ? p-s : n);
}



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