Alexander Carôt | 1 Jul 09:06 2010
Picon
Picon

Re: usleep not available ?

> Oops, I hadn't noticed libmingwex nowadays indeed has a usleep().
> Thanks, zouzou. Still, looking in its source shows that is just does:
> 
>    Sleep((useconds + 999) / 1000);

... yes - the same as it is the case with the nanosleep implementation. So, Sleep indeed takes values below 1,
which I didn't expect at all. Nevertheless, I am wondering how accurate this will be. I will go and figure.

One last thing: Despite including <unistd.h> it tells me "usleep was not declared in this scope". So far
that confuses me. I just installed the latest Mingw but it did not lead to a change. I anyone has a further
guess why, please let me know.

Thanks

-- A l e x

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
(Continue reading)

Tor Lillqvist | 1 Jul 10:17 2010
Picon
Picon

Re: usleep not available ?

>>    Sleep((useconds + 999) / 1000);

> So, Sleep indeed takes values below 1,

I certainly doesn't. (Well, it takes zero.) The argument to it is a
DWORD, an unsigned 32-bit integer.  (useconds + 999) / 1000  is an
integer division which results in an integer result. (And even if it
was an expression of type float or double, the prototype for Sleep()
means the argument would be converted to a DWORD before calling
Sleep() anyway. Perhaps you need to read up on how the C language
works.)

> Nevertheless, I am wondering how accurate this will be.

As that article that was linked to earlier in this thread showed
through experimentation, not very accurate.

> One last thing: Despite including <unistd.h> it tells me "usleep was not declared in this scope".

Is C++ involved?

--tml

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...
(Continue reading)

Alexander Carôt | 1 Jul 10:47 2010
Picon
Picon

Re: usleep not available ?

Perhaps you need to read up on how the C language
works.)

No - really not at all. I am simply terribly involved with other stuff, which is why I appreciate such quick pointers from your side very much.

As that article that was linked to earlier in this thread showed
through experimentation, not very accurate.

Well - of course according to my requirements and not in general. Once I have checked that I will report back.

One last thing: Despite including <unistd.h> it tells me "usleep was not declared in this scope".

Is C++ involved?

Yes, it is. Can you tell what to be done ?

Thanks again and best regards

-- A l e x


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Greg Chicares | 1 Jul 11:03 2010
Picon
Picon

Re: usleep not available ?

On 2010-07-01 07:06Z, Alexander Carôt wrote:
> 
> One last thing: Despite including <unistd.h> it tells me
> "usleep was not declared in this scope". So far that confuses me.

Are you using a makefile that defines '__NO_ISOCEXT'?

Is there another 'unistd.h' earlier on the include path?
Or an include file that redefines 'usleep'?

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Alexander Carôt | 1 Jul 11:25 2010
Picon
Picon

Re: usleep not available ?

Hi Greg,

> Are you using a makefile that defines '__NO_ISOCEXT'?
> 
> Is there another 'unistd.h' earlier on the include path?
> Or an include file that redefines 'usleep'?

no - neither way. The current project uses Qt and works fine on OSX and Linux. The Makefile is generated via
qmake and does not define __NO_ISOCEXT. Porting it to Mingw has been pretty uncomplicated so far -- just
this little usleep problem remaining. Tor mentioned C++ involvement earlier. In what sense could that be
related ?

Best

-- A l e x  
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Greg Chicares | 1 Jul 11:55 2010
Picon
Picon

Re: usleep not available ?

On 2010-07-01 09:25Z, Alexander Carôt wrote:
> 
>> Are you using a makefile that defines '__NO_ISOCEXT'?
>> 
>> Is there another 'unistd.h' earlier on the include path?
>> Or an include file that redefines 'usleep'?
> 
> no - neither way. The current project uses Qt and works fine on OSX and Linux.
> The Makefile is generated via qmake and does not define __NO_ISOCEXT.

Then I'm out of quick ideas. I looked at <unistd.h>, and it seems to
declare usleep() as long as that macro is not defined.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Tor Lillqvist | 1 Jul 12:05 2010
Picon
Picon

Re: usleep not available ?

> Tor mentioned C++ involvement earlier. In what sense could that be related ?

I am not a C++ expert (thank goddess), but namespaces and stuff?
Perhaps you need to write ::usleep()?

--tml

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Alexander Carôt | 1 Jul 12:37 2010
Picon
Picon

Re: usleep not available ?

> Then I'm out of quick ideas. I looked at <unistd.h>, and it seems to
> declare usleep() as long as that macro is not defined.

Thanks Tor and Greg -- I will check it asap and will get back. It appears to be a tiny "stupid" problem on my end.
Once I have figured I will call.

Best

-- A l e x  

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Martin Klos | 1 Jul 20:21 2010
Picon

io.h in system include directory overridden by local one

I am trying to build indent-2.2.9 under mingw and msys. This is my first ever build package build.

Mingw is installed in c:\mingw and Msys is in c:\msys\1.0.

I ran "configure --prefix=/mingw" then make

make fails on the first file, backup.c with this message

  source='backup.c' object='backup.o' libtool=no \
          depfile='.deps/backup.Po' tmpdepfile='.deps/backup.TPo' \
          depmode=gcc3 /bin/sh ../config/depcomp \
          gcc -DHAVE_CONFIG_H -DLOCALEDIR=\"/mingw/share/locale\" -I. -I. -I.. -I. -I. -I../intl  -g -O2 -c `test
-f 'backup.c' || echo './'`backup.c
  In file included from backup.c:89:
  c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/dirent.h:38: error: field `dd_dta'
has incomplete type
  c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/dirent.h:85: error: field `dd_dta'
has incomplete type
  make[3]: *** [backup.o] Error 1

I have traced the problem to the fact that this package contains a file called io.h and is
referenced from backup.c as 
  #include "io.h"

On the other hand, dirent.h references the system include file io.h as
  #include <io.h>

I think that the compiler is supposed to differentiate between these two files based on 
configuration of the include file paths. Is this right? 

If so I cannot determine how to set the include path so that files bracketed with <>
are included before other directories.

Any guidance is appreciated.

Best regards,
Marty

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Keith Marshall | 1 Jul 22:29 2010
Picon
Picon

Re: io.h in system include directory overridden by local one

On Thursday 01 July 2010 19:21:25 Martin Klos wrote:
> I have traced the problem to the fact that this package contains a
> file called io.h and is referenced from backup.c as
>   #include "io.h"
>
> On the other hand, dirent.h references the system include file io.h
> as #include <io.h>
>
> I think that the compiler is supposed to differentiate between
> these two files based on configuration of the include file paths.
> Is this right?
>
> If so I cannot determine how to set the include path so that files
> bracketed with <> are included before other directories.

http://gcc.gnu.org/onlinedocs/

Pick the version most appropriate to the compiler in use, and look for 
the options controlling directory search, in particular the -iquote 
and -isystem options, (or -I- for pre-GCC-4.x IIRC).

However, it would probably be better to rename the package's io.h, to 
avoid the conflict in the first place.

-- 
HTH,
Keith.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users


Gmane