georgmartius / vid.stab

Video stabilization library
http://public.hronopik.de/vid.stab/
Other
843 stars 108 forks source link

Compiling using Mingw #7

Closed Ajaja closed 11 years ago

Ajaja commented 11 years ago

There is a problem with compiling vid.stab using Mingw:

/vid.stab-master/src/libvidstab.c:61:27: error: 'strndup' undeclared here (not in a function)
 vs_strndup_t vs_strndup = strndup;

As I know strndup() is not required by ISO-C99 and Mingw doesn't implement it. For now I just add into libvidstab.c for mingw my own (maybe wrong) implementation of strndup:

static inline char *strndup(const char *s, size_t n)
{
    char *result;
    size_t len = strlen (s);
    if (n < len) len = n;
    result = (char *) malloc (len + 1);
    if (!result) return 0;
    result[len] = '\0';
    return (char *) strncpy (result, s, len);
}

But I do not see where does strndup used in vid.stab at all.

georgmartius commented 11 years ago

Hello. Just shortly. It my nite be used anymore in the lib code. The transcode plugins use it. I am away for 2months. Will fix it afterwards. Georg

Ajaja notifications@github.com schrieb:

There is a problem with compiling vid.stab using Mingw:

/vid.stab-master/src/libvidstab.c:61:27: error: 'strndup' undeclared
here (not in a function)
vs_strndup_t vs_strndup = strndup;

As I know strndup() is not required by ISO-C99 and Mingw doesn't implement it. For now I just add into libvidstab.c for mingw my own (maybe wrong) implementation of strndup:

static inline char *strndup(const char *s, size_t n)
{
   char *result;
   size_t len = strlen (s);
   if (n < len) len = n;
   result = (char *) malloc (len + 1);
   if (!result) return 0;
   result[len] = '\0';
   return (char *) strncpy (result, s, len);
}

But I do not see where does strndup used in vid.stab at all.


Reply to this email directly or view it on GitHub: https://github.com/georgmartius/vid.stab/issues/7

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Fearmac commented 11 years ago

Hello,

Did you have time to take a look at the issue?

thanks