public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/23802] New: [mingw32] sleep malfunction
@ 2005-09-09 21:30 fxcoudert at gcc dot gnu dot org
  2005-09-09 21:32 ` Andrew Pinski
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-09-09 21:30 UTC (permalink / raw)
  To: gcc-bugs

$ cat sleep.f
      call sleep(3)
      end
$ ./bin/gfortran.exe sleep.f
$ time a
real    0m0.040s
user    0m0.010s
sys     0m0.010s

sleep simply doesn't work. We should include <windows.h> and use Sleep (note the
capital S).

Proposed patch (but this needs another patch to define TARGET_IS_MINGW):

Index: intrinsics/sleep.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/intrinsics/sleep.c,v
retrieving revision 1.2
diff -p -u -r1.2 sleep.c
--- intrinsics/sleep.c  17 Aug 2005 02:48:54 -0000      1.2
+++ intrinsics/sleep.c  9 Sep 2005 21:26:01 -0000
@@ -39,6 +39,14 @@ Boston, MA 02110-1301, USA.  */
 #include <unistd.h>
 #endif
 
+#ifdef TARGET_IS_MINGW
+# include <windows.h>
+# ifdef sleep
+#  undef sleep
+# endif
+# define sleep(x) Sleep(1000*(x))
+#endif
+
 /* SUBROUTINE SLEEP(SECONDS)
    INTEGER, INTENT(IN) :: SECONDS

-- 
           Summary: [mingw32] sleep malfunction
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i386-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23802


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libfortran/23802] [mingw32] sleep malfunction
  2005-09-09 21:30 [Bug libfortran/23802] New: [mingw32] sleep malfunction fxcoudert at gcc dot gnu dot org
  2005-09-09 21:32 ` Andrew Pinski
@ 2005-09-09 21:32 ` pinskia at physics dot uc dot edu
  2005-09-24  8:55 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2005-09-09 21:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at physics dot uc dot edu  2005-09-09 21:32 -------
Subject: Re:  New: [mingw32] sleep malfunction


On Sep 9, 2005, at 5:30 PM, fxcoudert at gcc dot gnu dot org wrote:

> +# ifdef sleep
> +#  undef sleep
> +# endif

You can undef it without having it defined and not worry about
a warning.

-- pinski



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23802


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bug libfortran/23802] New: [mingw32] sleep malfunction
  2005-09-09 21:30 [Bug libfortran/23802] New: [mingw32] sleep malfunction fxcoudert at gcc dot gnu dot org
@ 2005-09-09 21:32 ` Andrew Pinski
  2005-09-09 21:32 ` [Bug libfortran/23802] " pinskia at physics dot uc dot edu
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Andrew Pinski @ 2005-09-09 21:32 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs


On Sep 9, 2005, at 5:30 PM, fxcoudert at gcc dot gnu dot org wrote:

> +# ifdef sleep
> +#  undef sleep
> +# endif

You can undef it without having it defined and not worry about
a warning.

-- pinski


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libfortran/23802] [mingw32] sleep malfunction
  2005-09-09 21:30 [Bug libfortran/23802] New: [mingw32] sleep malfunction fxcoudert at gcc dot gnu dot org
  2005-09-09 21:32 ` Andrew Pinski
  2005-09-09 21:32 ` [Bug libfortran/23802] " pinskia at physics dot uc dot edu
@ 2005-09-24  8:55 ` cvs-commit at gcc dot gnu dot org
  2005-09-24  8:59 ` [Bug libfortran/23802] [4.0 only] " fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-24  8:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-24 08:55 -------
Subject: Bug 23802

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	fxcoudert@gcc.gnu.org	2005-09-24 08:55:38

Modified files:
	libgfortran    : ChangeLog 
	libgfortran/intrinsics: sleep.c 

Log message:
	PR libfortran/23802
	* intrinsics/sleep.c: Add correct sleep macro for MinGW.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.305&r2=1.306
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/sleep.c.diff?cvsroot=gcc&r1=1.2&r2=1.3



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23802


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libfortran/23802] [4.0 only] [mingw32] sleep malfunction
  2005-09-09 21:30 [Bug libfortran/23802] New: [mingw32] sleep malfunction fxcoudert at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-09-24  8:55 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-24  8:59 ` fxcoudert at gcc dot gnu dot org
  2005-09-29 12:29 ` cvs-commit at gcc dot gnu dot org
  2005-09-29 12:30 ` [Bug libfortran/23802] " fxcoudert at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-09-24  8:59 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
      Known to fail|                            |4.0.2
      Known to work|                            |4.1.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-24 08:59:32
               date|                            |
            Summary|[mingw32] sleep malfunction |[4.0 only] [mingw32] sleep
                   |                            |malfunction
   Target Milestone|---                         |4.1.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23802


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libfortran/23802] [4.0 only] [mingw32] sleep malfunction
  2005-09-09 21:30 [Bug libfortran/23802] New: [mingw32] sleep malfunction fxcoudert at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-09-24  8:59 ` [Bug libfortran/23802] [4.0 only] " fxcoudert at gcc dot gnu dot org
@ 2005-09-29 12:29 ` cvs-commit at gcc dot gnu dot org
  2005-09-29 12:30 ` [Bug libfortran/23802] " fxcoudert at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-29 12:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-29 12:29 -------
Subject: Bug 23802

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	fxcoudert@gcc.gnu.org	2005-09-29 12:28:52

Modified files:
	libgfortran    : ChangeLog 
	libgfortran/intrinsics: cpu_time.c getXid.c getlog.c hostnm.c 
	                        sleep.c 

Log message:
	Backport from mainline:
	PR libfortran/23380
	PR libfortran/23802
	PR libfortran/23803
	* intrinsics/getXid.c: Add getpid wrapper for MinGW.
	* intrinsics/getlog.c: Add getlogin wrapper for MinGW.
	* intrinsics/hostnm.c: Add gethostname wrapper for MinGW.
	* intrinsics/sleep.c: Add correct sleep macro for MinGW.
	* intrinsics/cpu_time.c (__cpu_time_1): Provide a MS Windows
	version.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.163.2.92&r2=1.163.2.93
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/cpu_time.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5&r2=1.5.12.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/getXid.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3&r2=1.3.12.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/getlog.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1.2.2&r2=1.1.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/hostnm.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1.2.1&r2=1.1.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/sleep.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1.2.1&r2=1.1.2.2



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23802


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libfortran/23802] [mingw32] sleep malfunction
  2005-09-09 21:30 [Bug libfortran/23802] New: [mingw32] sleep malfunction fxcoudert at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-09-29 12:29 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-29 12:30 ` fxcoudert at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-09-29 12:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-09-29 12:30 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
            Summary|[4.0 only] [mingw32] sleep  |[mingw32] sleep malfunction
                   |malfunction                 |
   Target Milestone|4.1.0                       |4.0.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23802


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-09-29 12:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-09 21:30 [Bug libfortran/23802] New: [mingw32] sleep malfunction fxcoudert at gcc dot gnu dot org
2005-09-09 21:32 ` Andrew Pinski
2005-09-09 21:32 ` [Bug libfortran/23802] " pinskia at physics dot uc dot edu
2005-09-24  8:55 ` cvs-commit at gcc dot gnu dot org
2005-09-24  8:59 ` [Bug libfortran/23802] [4.0 only] " fxcoudert at gcc dot gnu dot org
2005-09-29 12:29 ` cvs-commit at gcc dot gnu dot org
2005-09-29 12:30 ` [Bug libfortran/23802] " fxcoudert at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).