Kaynağa Gözat

* Don't use mygetopt.c in img2txt if the system has getopt_long.

* Fix invalid pointer/int cast (Closes #39).
tags/v0.99.beta14
Sam Hocevar sam 17 yıl önce
ebeveyn
işleme
e4fae06a5e
3 değiştirilmiş dosya ile 15 ekleme ve 11 silme
  1. +7
    -2
      configure.ac
  2. +7
    -2
      src/Makefile.am
  3. +1
    -7
      src/mygetopt.c

+ 7
- 2
configure.ac Dosyayı Görüntüle

@@ -91,11 +91,16 @@ AC_CHECK_HEADERS(stdio.h stdarg.h signal.h sys/ioctl.h sys/time.h inttypes.h end
AC_CHECK_FUNCS(signal ioctl snprintf vsnprintf getenv putenv strcasecmp htons)
AC_CHECK_FUNCS(usleep gettimeofday)

ac_cv_have_getopt_long="no"
AC_CHECK_FUNCS(getopt_long,
[AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)],
[ac_cv_have_getopt_long="yes"],
[AC_CHECK_LIB(gnugetopt, getopt_long,
[AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
[ac_cv_have_getopt_long="yes"
GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
if test "$ac_cv_have_getopt_long" != "no"; then
AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
fi
AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
AC_SUBST(GETOPT_LIBS)

AC_MSG_CHECKING(for Sleep)


+ 7
- 2
src/Makefile.am Dosyayı Görüntüle

@@ -29,13 +29,18 @@ cacaplay_LDADD = ../caca/libcaca.la ../cucul/libcucul.la
cacaserver_SOURCES = cacaserver.c
cacaserver_LDADD = ../cucul/libcucul.la

img2txt_SOURCES = img2txt.c mygetopt.c mygetopt.h common-image.c common-image.h
img2txt_SOURCES = img2txt.c $(GETOPT) common-image.c common-image.h
img2txt_LDADD = ../cucul/libcucul.la
img2txt_CFLAGS = $(IMLIB2_CFLAGS)
img2txt_LDFLAGS = $(IMLIB2_LIBS)
img2txt_LDFLAGS = $(IMLIB2_LIBS) $(GETOPT_LIBS)

if USE_NETWORK
fcntl_programs = cacaserver
else
fcntl_programs =
endif

if NEED_GETOPT_LONG
GETOPT = mygetopt.c mygetopt.h
endif


+ 1
- 7
src/mygetopt.c Dosyayı Görüntüle

@@ -17,6 +17,7 @@
*/

#include "config.h"
#include "common.h"

#if defined HAVE_STDINT_H
# include <stdint.h>
@@ -24,13 +25,6 @@
# include <inttypes.h>
#endif

/* DOS / Kernel driver */
#ifndef __intptr_t_defined
#ifndef _UINTPTR_T
typedef unsigned int uintptr_t;
#endif
#endif

#include <stdio.h>
#include <string.h>



Yükleniyor…
İptal
Kaydet