re PR libgcj/30606 (natVMURLConnection.cc:21: error: 'magic_t' does not name a typet name a type)
PR libgcj/30606: * configure, include/config.h.in: Rebuilt. * configure.ac: Check for magic_t in magic.h. * java/net/natVMURLConnection.cc: Use HAVE_MAGIC_T. From-SVN: r121425
This commit is contained in:
parent
8de15ffc9d
commit
7679f36836
5 changed files with 90 additions and 6 deletions
|
@ -13,7 +13,7 @@ details. */
|
|||
#include <java/lang/UnsupportedOperationException.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined (HAVE_MAGIC_H) && defined (USE_LTDL)
|
||||
#if defined (HAVE_MAGIC_T) && defined (HAVE_MAGIC_H) && defined (USE_LTDL)
|
||||
|
||||
#include <magic.h>
|
||||
#include <ltdl.h>
|
||||
|
@ -26,12 +26,12 @@ static void (*p_magic_close)(magic_t cookie);
|
|||
static const char * (*p_magic_buffer) (magic_t cookie, const void *buffer,
|
||||
size_t length);
|
||||
|
||||
#endif /* HAVE_MAGIC_H && defined (USE_LTDL) */
|
||||
#endif /* HAVE_MAGIC_T && HAVE_MAGIC_H && defined (USE_LTDL) */
|
||||
|
||||
void
|
||||
java::net::VMURLConnection::init ()
|
||||
{
|
||||
#if defined (HAVE_MAGIC_H) && defined (USE_LTDL)
|
||||
#if defined (HAVE_MAGIC_T) && defined (HAVE_MAGIC_H) && defined (USE_LTDL)
|
||||
lt_dlhandle handle = lt_dlopenext ("libmagic.so");
|
||||
if (!handle)
|
||||
return;
|
||||
|
@ -57,14 +57,14 @@ java::net::VMURLConnection::init ()
|
|||
p_magic_close (cookie);
|
||||
cookie = (magic_t) NULL;
|
||||
}
|
||||
#endif /* HAVE_MAGIC_H && defined (USE_LTDL) */
|
||||
#endif /* HAVE_MAGIC_T && HAVE_MAGIC_H && defined (USE_LTDL) */
|
||||
}
|
||||
|
||||
::java::lang::String *
|
||||
java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes,
|
||||
jint valid)
|
||||
{
|
||||
#if defined (HAVE_MAGIC_H) && defined (USE_LTDL)
|
||||
#if defined (HAVE_MAGIC_T) && defined (HAVE_MAGIC_H) && defined (USE_LTDL)
|
||||
const char *result;
|
||||
|
||||
if (cookie == (magic_t) NULL)
|
||||
|
@ -77,5 +77,5 @@ java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes,
|
|||
return _Jv_NewStringUTF (result);
|
||||
#else
|
||||
return NULL;
|
||||
#endif /* HAVE_MAGIC_H && defined (USE_LTDL) */
|
||||
#endif /* HAVE_MAGIC_T && HAVE_MAGIC_H && defined (USE_LTDL) */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue