Permalink
Browse files

modifications to lib/ and src/: compile and run on Android

  • Loading branch information...
zielmicha committed Aug 2, 2012
1 parent de81159 commit 5c1b1a228eb2e0b1968b165d3d1d2edb3c4c12c3
Showing with 26 additions and 11 deletions.
  1. +3 −0 lib/getopt.c
  2. +2 −0 lib/getopt1.c
  3. +1 −1 lib/getopt_int.h
  4. +1 −0 lib/stat-time.h
  5. +2 −1 src/buffer.c
  6. +1 −1 src/dispnew.c
  7. +2 −2 src/emacs.c
  8. +3 −2 src/fileio.c
  9. +1 −1 src/fns.c
  10. +4 −3 src/print.c
  11. +2 −0 src/process.c
  12. +4 −0 src/vm-limit.c
View
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if 0
+
#ifndef _LIBC
# include <config.h>
#endif
@@ -1243,3 +1245,4 @@ main (int argc, char **argv)
}
#endif /* TEST */
+#endif
View
@@ -16,6 +16,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if 0
#ifdef _LIBC
# include <getopt.h>
#else
@@ -168,3 +169,4 @@ main (int argc, char **argv)
}
#endif /* TEST */
+#endif
View
@@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#ifndef _GETOPT_INT_H
+#if 0
#define _GETOPT_INT_H 1
#include <getopt.h>
View
@@ -31,6 +31,7 @@
time respectively.
These macros are private to stat-time.h. */
+
#if defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
# ifdef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim)
View
@@ -5089,7 +5089,8 @@ init_buffer (void)
if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
Fset_buffer_multibyte (Qnil);
- pwd = get_current_dir_name ();
+ pwd = malloc(1024); /*get_current_dir_name ();*/
+ getcwd(pwd, 1023);
if (!pwd)
fatal ("`get_current_dir_name' failed: %s\n", strerror (errno));
View
@@ -4675,7 +4675,7 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
FILE *display_output = FRAME_TTY (f)->output;
if (display_output)
{
- int outq = PENDING_OUTPUT_COUNT (display_output);
+ int outq = 0/*PENDING_OUTPUT_COUNT (display_output)*/;
if (outq > 900
|| (outq > 20 && ((i - 1) % preempt_count == 0)))
{
View
@@ -357,7 +357,7 @@ memory_warning_signal (int sig)
so that GDB can return from a breakpoint here.
MSDOS has its own definition in msdos.c. */
-#if ! defined (DOS_NT) && ! defined (NO_ABORT)
+#if ! defined (DOS_NT) && ! defined (NO_ABORT) && 0
void
abort (void)
@@ -1107,7 +1107,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
#if defined (USG5) && defined (INTERRUPT_INPUT)
setpgrp ();
#endif
-#if defined (HAVE_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
+#if 0
{
extern void malloc_enable_thread (void);
View
@@ -2032,7 +2032,8 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
}
}
if (fchmod (ofd, st.st_mode & mode_mask) != 0)
- report_file_error ("Doing chmod", Fcons (newname, Qnil));
+// on Android sdcard chmod will fail with ENOPERM
+ ; /*report_file_error ("Doing chmod", Fcons (newname, Qnil));*/
}
#endif /* not MSDOS */
@@ -2980,7 +2981,7 @@ symbolic notation, like the `chmod' command from GNU Coreutils. */)
encoded_absname = ENCODE_FILE (absname);
if (chmod (SSDATA (encoded_absname), XINT (mode) & 07777) < 0)
- report_file_error ("Doing chmod", Fcons (absname, Qnil));
+ ; /*report_file_error ("Doing chmod", Fcons (absname, Qnil));*/
return Qnil;
}
View
@@ -2523,7 +2523,7 @@ advisable. */)
(Lisp_Object use_floats)
{
double load_ave[3];
- int loads = getloadavg (load_ave, 3);
+ int loads = -1 /*getloadavg (load_ave, 3)*/;
Lisp_Object ret = Qnil;
if (loads < 0)
View
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <setjmp.h>
+#include "config.h"
#include "lisp.h"
#include "character.h"
#include "buffer.h"
@@ -764,17 +765,17 @@ append to existing target file. */)
fclose (stderr);
UNBLOCK_INPUT;
}
- stderr = initial_stderr_stream;
+ android_set_stderr(initial_stderr_stream);
initial_stderr_stream = NULL;
if (STRINGP (file))
{
file = Fexpand_file_name (file, Qnil);
initial_stderr_stream = stderr;
- stderr = fopen (SSDATA (file), NILP (append) ? "w" : "a");
+ android_set_stderr( fopen (SSDATA (file), NILP (append) ? "w" : "a") );
if (stderr == NULL)
{
- stderr = initial_stderr_stream;
+ android_set_stderr(initial_stderr_stream);
initial_stderr_stream = NULL;
report_file_error ("Cannot open debugging output stream",
Fcons (file, Qnil));
View
@@ -6255,10 +6255,12 @@ process has been transmitted to the serial port. */)
send_process (proc, "\004", 1, Qnil);
else if (EQ (XPROCESS (proc)->type, Qserial))
{
+ #if 0
#ifndef WINDOWSNT
if (tcdrain (XPROCESS (proc)->outfd) != 0)
error ("tcdrain() failed: %s", emacs_strerror (errno));
#endif /* not WINDOWSNT */
+ #endif
/* Do nothing on Windows because writes are blocking. */
}
else
View
@@ -165,6 +165,7 @@ get_lim_data (void)
static void
check_memory_limits (void)
{
+ #if 0
#ifdef REL_ALLOC
extern POINTER (*real_morecore) (long);
#endif
@@ -235,6 +236,7 @@ check_memory_limits (void)
if (EXCEEDS_LISP_PTR (cp))
(*warn_function) ("Warning: memory in use exceeds lisp pointer size");
+ #endif
}
#if !defined (CANNOT_DUMP) || !defined (SYSTEM_MALLOC)
@@ -284,6 +286,7 @@ start_of_data (void)
void
memory_warnings (POINTER start, void (*warnfun) (const char *))
{
+ #if 0
extern void (* __after_morecore_hook) (void); /* From gmalloc.c */
if (start)
@@ -293,6 +296,7 @@ memory_warnings (POINTER start, void (*warnfun) (const char *))
warn_function = warnfun;
__after_morecore_hook = check_memory_limits;
+ #endif
/* Force data limit to be recalculated on each run. */
lim_data = 0;

0 comments on commit 5c1b1a2

Please sign in to comment.