grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] patch to compile grub2 in msys/mingw environment


From: Bean
Subject: Re: [PATCH] patch to compile grub2 in msys/mingw environment
Date: Wed, 18 Mar 2009 21:43:33 +0800

On Wed, Mar 18, 2009 at 6:15 PM, Robert Millan <address@hidden> wrote:
> On Tue, Mar 17, 2009 at 01:54:22PM +0800, Bean wrote:
>> >
>> > It seems you defined the mingw32 version of grub_millisleep 
>> > unconditionally.
>>
>> Hi,
>>
>> Are you suggesting adding some test in configure.ac ? Although
>> grub_millisleep for mingw32 uses Windows API Sleep, I guess it's safe
>> to assume it's present.
>
> I just meant that when __MINGW32__ is not defined, the function is implemented
> twice:
>
>> +#ifndef __MINGW32__
>>  void
>>  grub_millisleep (grub_uint32_t ms)
>>  {
>> @@ -320,6 +321,7 @@ grub_millisleep (grub_uint32_t ms)
>>    ts.tv_nsec = (ms % 1000) * 1000000;
>>    nanosleep (&ts, NULL);
>>  }
>> +#endif
>>
>>  void
>>  grub_arch_sync_caches (void *address __attribute__ ((unused)),
>> @@ -361,6 +363,12 @@ void sleep (int s)
>>    Sleep (s * 1000);
>>  }
>>
>> +void
>> +grub_millisleep (grub_uint32_t ms)
>> +{
>> +  Sleep (ms);
>> +}
>> +
>
> why not put them together anyway?  Like #ifdef __MINGW32__ ... #else ... 
> #endif

Hi,

The header file <windows.h> is included after grub_millisleep, so
Sleep is not defined yet, perhaps it'd be better to move #include
<windows.h> to the beginning of file.

-- 
Bean




reply via email to

[Prev in Thread] Current Thread [Next in Thread]