List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:June 4 2008 12:27pm
Subject:Re: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653)
Bug#24509, WL#3049
View as plain text  
Hi Vlad,

Vladislav Vaintroub wrote:
> Hi all,
> what Davi describes is a sane approach, that  if consistently applied can
> result into high quality library, like Apache Portable Runtime. Hence , it
> is not applicable for us ;)

Heh. .oO(hum, we could drop mysys and start using the APR)

> Seriously, we do need a top-level mapper functions. The reason is that many
> mysys IO functions include large chunks of code shared on all OS (error
> handling, messing up with my_file_info array) and  it does not make sense to
> replicate those chunks for every OS. What could make sense for Windows is to
> create win_file_io.c with ANSI/Posix wrappers. Then, use these wrappers in
> the mysys function.
> 
> To illustrate, this approach would make piece of code like this 
> 
> #ifndef __WIN__
>   fd = fdopen(Filedes, type);
> #else
>   {
>     /* Convert OS file handle to CRT file descriptor and then call fdopen*/
>     int crt_fd = _open_osfhandle((intptr_t)my_get_osfhandle(Filedes), 0);
>     if(crt_fd < 0)
>       fd = 0;
>     else
>       fd = fdopen(crt_fd, type);
>   }
> #endif
> 
> less cluttered (still with #ifdefs though)
> 
> #ifndef __WIN__
>   fd = fdopen(Filedes, type);
> #else
>   fd = my_win_fdopen(Filedes, type);
> #endif
> 

+1 on this approach. Where do you plan to keep my_win_fdopen? I hope
it's on a different file, but anyway.. it's much better.

Regards,

-- 
Davi Arnaut, Software Engineer
MySQL Server Runtime Team
Database Group, Sun Microsystems
Thread
commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653) Bug#24509,WL#3049Vladislav Vaintroub4 Jun
  • Re: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653)Bug#24509, WL#3049Davi Arnaut4 Jun
    • Re: commit into mysql-6.0-wtf:mysql-6.0-wtf branch(vvaintroub:2653) Bug#24509, WL#3049Konstantin Osipov4 Jun
    • Re: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653)Bug#24509, WL#3049Joerg Bruehe4 Jun
      • RE: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653) Bug#24509, WL#3049Vladislav Vaintroub4 Jun
        • Re: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653)Bug#24509, WL#3049Davi Arnaut4 Jun
          • RE: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653) Bug#24509, WL#3049Vladislav Vaintroub4 Jun
            • Re: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653)Bug#24509, WL#3049Davi Arnaut4 Jun
        • Re: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653)Bug#24509, WL#3049Joerg Bruehe4 Jun
          • Re: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653)Bug#24509, WL#3049 [ifdefery]Davi Arnaut5 Jun
      • Re: commit into mysql-6.0-wtf:mysql-6.0-wtf branch (vvaintroub:2653)Bug#24509, WL#3049Davi Arnaut4 Jun