Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix iOS 5.0 issue (file descriptors for regular files can't be put in…

… nonblocking mode).
  • Loading branch information...
commit f9b1ff44a96e7a8f0a419fa9caf0034a42096048 1 parent 60cf720
@feeley authored
View
145 configure
@@ -13718,6 +13718,151 @@ fi
done
+for ac_header in TargetConditionals.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## -------------------------------------- ##
+## Report this to gambit@iro.umontreal.ca ##
+## -------------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
if test "$C_COMP_VISUALC" != yes; then
View
1  configure.ac
@@ -680,6 +680,7 @@ else
AC_CHECK_HEADERS(sys/sysctl.h)
AC_CHECK_HEADERS(crt_externs.h)
AC_CHECK_HEADERS(ws2tcpip.h)
+ AC_CHECK_HEADERS(TargetConditionals.h)
if test "$C_COMP_VISUALC" != yes; then
View
BIN  examples/iOS/GambitREPL.xcodeproj.tgz
Binary file not shown
View
14 examples/iOS/Info.plist
@@ -5,9 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
- <string>Gambit REPL dev</string>
- <key>CFBundleDocumentTypes</key>
- <array/>
+ <string>Gambit REPL</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
@@ -28,13 +26,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>6.0</string>
+ <string>6.1</string>
<key>CFBundleSignature</key>
<string>GamC</string>
- <key>CFBundleURLTypes</key>
- <array/>
<key>CFBundleVersion</key>
- <string>6.0</string>
+ <string>6.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
@@ -47,9 +43,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
- <key>UTExportedTypeDeclarations</key>
- <array/>
- <key>UTImportedTypeDeclarations</key>
- <array/>
</dict>
</plist>
View
2  include/config.h.in
@@ -97,6 +97,8 @@
#undef HAVE_MEMORY_H
#undef HAVE_SYS_SYSCTL_H
#undef HAVE_CRT_EXTERNS_H
+#undef HAVE_WS2TCPIP_H
+#undef HAVE_TARGETCONDITIONALS_H
/*---------------------------------------------------------------------------*/
View
4 include/stamp.h
@@ -2,5 +2,5 @@
* Time stamp of last source code repository commit.
*/
-#define ___STAMP_YMD 20120206
-#define ___STAMP_HMS 23127
+#define ___STAMP_YMD 20120207
+#define ___STAMP_HMS 205239
View
13 lib/os.h
@@ -184,6 +184,17 @@
#endif
#endif
+#define USE_NONBLOCKING_FILE_IO
+
+#ifdef HAVE_TARGETCONDITIONALS_H
+#include <TargetConditionals.h>
+#ifdef TARGET_OS_IPHONE
+#if TARGET_OS_IPHONE == 1
+#undef USE_NONBLOCKING_FILE_IO
+#endif
+#endif
+#endif
+
#ifdef HAVE_STRERROR
#define USE_strerror
#endif
@@ -956,7 +967,6 @@ ___END_C_LINKAGE
#define INCLUDE_curses_h
#endif
-
/*---------------------------------------------------------------------------*/
/* Inclusion of header files. */
@@ -1396,7 +1406,6 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
#endif
#endif
-
/*
* Use the process-time timer unless only the real-time timer is
* available (e.g. DJGPP). Note that on some systems (e.g. MkLinux)
View
22 lib/os_io.c
@@ -6071,13 +6071,6 @@ int direction;)
}
else
{
- /*
- * Setup file descriptor to perform nonblocking I/O.
- */
-
- if (set_fd_blocking_mode (fd, 0) != 0) /* set nonblocking mode */
- return err_code_from_errno ();
-
switch (kind)
{
@@ -6087,6 +6080,7 @@ int direction;)
{
___device_tcp_client *d;
struct sockaddr server_addr;
+
if ((e = ___device_tcp_client_setup_from_socket
(&d,
dgroup,
@@ -6097,6 +6091,7 @@ int direction;)
direction))
== ___FIX(___NO_ERR))
*dev = ___CAST(___device_stream*,d);
+
break;
}
@@ -6105,6 +6100,18 @@ int direction;)
case ___FILE_DEVICE_KIND:
{
___device_file *d;
+
+#ifdef USE_NONBLOCKING_FILE_IO
+
+ /*
+ * Setup file descriptor to perform nonblocking I/O.
+ */
+
+ if (set_fd_blocking_mode (fd, 0) != 0) /* set nonblocking mode */
+ return err_code_from_errno ();
+
+#endif
+
if ((e = ___device_file_setup_from_fd
(&d,
dgroup,
@@ -6112,6 +6119,7 @@ int direction;)
direction))
== ___FIX(___NO_ERR))
*dev = ___CAST(___device_stream*,d);
+
break;
}
Please sign in to comment.
Something went wrong with that request. Please try again.