]> git.sesse.net Git - vlc/blobdiff - src/extras/libc.c
Sync PO files
[vlc] / src / extras / libc.c
index 4f62486e25871178225b180999c0f66f1d822473..f58f05fe77899f3a59d67608bdb0a739a575fd55 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 
 #include <ctype.h>
 
@@ -322,23 +322,16 @@ int vlc_wclosedir( void *_p_dir )
 #endif
 }
 
-#if defined (WIN32)
-/**
- * gettext callbacks for plugins.
- * LibVLC links libintl statically on Windows.
- */
-char *vlc_dgettext( const char *package, const char *msgid )
-{
-    return dgettext( package, msgid );
-}
-#endif
-
 /**
  * In-tree plugins share their gettext domain with LibVLC.
  */
 char *vlc_gettext( const char *msgid )
 {
+#ifdef ENABLE_NLS
     return dgettext( PACKAGE_NAME, msgid );
+#else
+    return (char *)msgid;
+#endif
 }
 
 /*****************************************************************************
@@ -424,7 +417,7 @@ vlc_iconv_t vlc_iconv_open( const char *tocode, const char *fromcode )
 #if defined(HAVE_ICONV)
     return iconv_open( tocode, fromcode );
 #else
-    return NULL;
+    return (vlc_iconv_t)(-1);
 #endif
 }
 
@@ -435,21 +428,7 @@ size_t vlc_iconv( vlc_iconv_t cd, const char **inbuf, size_t *inbytesleft,
     return iconv( cd, (ICONV_CONST char **)inbuf, inbytesleft,
                   outbuf, outbytesleft );
 #else
-    int i_bytes;
-
-    if (inbytesleft == NULL || outbytesleft == NULL)
-    {
-        return 0;
-    }
-
-    i_bytes = __MIN(*inbytesleft, *outbytesleft);
-    if( !inbuf || !outbuf || !i_bytes ) return (size_t)(-1);
-    memcpy( *outbuf, *inbuf, i_bytes );
-    inbuf += i_bytes;
-    outbuf += i_bytes;
-    inbytesleft -= i_bytes;
-    outbytesleft -= i_bytes;
-    return i_bytes;
+    abort ();
 #endif
 }
 
@@ -458,7 +437,7 @@ int vlc_iconv_close( vlc_iconv_t cd )
 #if defined(HAVE_ICONV)
     return iconv_close( cd );
 #else
-    return 0;
+    abort ();
 #endif
 }