[Python-checkins] CVS: python/dist/src/Modules main.c,1.51,1.52 timemodule.c,2.109,2.110

Guido van Rossum gvanrossum@users.sourceforge.net
Tue, 10 Apr 2001 15:07:09 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv8619

Modified Files:
	main.c timemodule.c 
Log Message:
Updated version of RISCOS support. SF patch 411213 by Dietmar Schwertberger

Index: main.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -r1.51 -r1.52
*** main.c	2001/03/22 02:47:57	1.51
--- main.c	2001/04/10 22:07:07	1.52
***************
*** 27,34 ****
  static int  orig_argc;
  
! /* For my_readline when running under RISCOS */
! #ifdef RISCOS
  extern int Py_RISCOSWimpFlag;
! #endif
  
  /* Short usage message (with %s for argv0) */
--- 27,42 ----
  static int  orig_argc;
  
! /* command line options */
! #define BASE_OPTS "c:diOStuUvxXhVW:"
! 
! #ifndef RISCOS
! #define PROGRAM_OPTS BASE_OPTS
! #else /*RISCOS*/
! /* extra option saying that we are running under a special task window
!    frontend; especially my_readline will behave different */
! #define PROGRAM_OPTS BASE_OPTS "w"
! /* corresponding flag */
  extern int Py_RISCOSWimpFlag;
! #endif /*RISCOS*/
  
  /* Short usage message (with %s for argv0) */
***************
*** 116,124 ****
  	PySys_ResetWarnOptions();
  
! #ifdef RISCOS
! 	while ((c = getopt(argc, argv, "c:diOStuUvwxXhV")) != EOF) {
! #else
! 	while ((c = _PyOS_GetOpt(argc, argv, "c:diOStuUvxXhVW:")) != EOF) {
! #endif
  		if (c == 'c') {
  			/* -c is the last option; following arguments
--- 124,128 ----
  	PySys_ResetWarnOptions();
  
! 	while ((c = _PyOS_GetOpt(argc, argv, PROGRAM_OPTS)) != EOF) {
  		if (c == 'c') {
  			/* -c is the last option; following arguments

Index: timemodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/timemodule.c,v
retrieving revision 2.109
retrieving revision 2.110
diff -C2 -r2.109 -r2.110
*** timemodule.c	2001/03/20 03:26:49	2.109
--- timemodule.c	2001/04/10 22:07:07	2.110
***************
*** 757,763 ****
  	/* XXX Can't interrupt this sleep */
  	Py_BEGIN_ALLOW_THREADS
- #ifndef RISCOS
  	delay((int)(secs * 1000 + 0.5));  /* delay() uses milliseconds */
- #endif
  	Py_END_ALLOW_THREADS
  #else /* !__WATCOMC__ || __QNX__ */
--- 757,761 ----
***************
*** 832,839 ****
--- 830,847 ----
  	}
  #else /* !__BEOS__ */
+ #ifdef RISCOS
+ 	if (secs <= 0.0)
+ 		return 0;
+ 	Py_BEGIN_ALLOW_THREADS
+ 	/* This sleep *CAN BE* interrupted. */
+ 	if ( sleep(secs) )
+ 		return -1;
+ 	Py_END_ALLOW_THREADS
+ #else /* !RISCOS */
  	/* XXX Can't interrupt this sleep */
  	Py_BEGIN_ALLOW_THREADS
  	sleep((int)secs);
  	Py_END_ALLOW_THREADS
+ #endif /* !RISCOS */
  #endif /* !__BEOS__ */
  #endif /* !PYOS_OS2 */