On 05/01/2008, Ben Schmidt <[EMAIL PROTECTED]> wrote:
> [This copy contains the attachment. Also, I forgot to mention that simply 
> changing
> the logic of preprocessing in, say, vim.h doesn't solve the problem. Features
> provided by the conflicting code are indeed needed together--you lose X
> functionality or MacRoman encoding functionality depending what is disabled, 
> and
> there's no easy way to reconcile it by playing preprocessor games.]
>
> Hi,
>
> I recently had trouble compiling Vim on Mac OS X 10.4.9 with GTK2 GUI. As is
> mentioned in the Vim source, the X headers and Mac headers clash horribly. 
> This
> means stuff has to be separated carefully into files that have X headers 
> available
> and those that have Mac headers available, and they weren't quite sorted out
> right. The attached patch fixes it by moving code around:
>
> - Moved from os_mac_conv.c to mac_gui.c and made static to that file:
>
>    - mac_utf16_to_enc
>    - mac_enc_to_utf16
>    - mac_enc_to_cfstring
>    - mac_utf16_to_utf8
>    - mac_utf8_to_utf16
>
> - A chunk of code from option.c has also been moved to os_mac_conv.c
>    as 'mac_lang_init()'.
>
> - And a preprocessor conditional in globals.h was changed so X headers
>    aren't expected when they aren't available.
>
> I thought it was the best of a bad bunch of options for fixing the issues.
>
> It now compiles for me, configured with
>
> ./configure --with-features=huge --enable-pythoninterp --enable-perlinterp
> --enable-rubyinterp --enable-tclinterp --enable-cscope --enable-gui=gtk2
>
> It would be good to have this or a similar fix in the official distribution.
>
> Might this have an effect on MacVim, Bjorn, or vim-coco, Jiang (sorry if names
> wrong...memory is hazy)? If so, perhaps you could suggest a better solution?

Unfortunately this patch will break MacVim compilation because of the
MacRoman encoding support won't get compiled (MacVim does not use
gui_mac.c, neither does vim-cocoa for that matter).  Why is it not
possible to have the encoding functions in a separate source file?

That being said, I don't think it is a very serious problem for
MacVim...but it will require some work to reconcile it with your
patch.  Either I'll have to move all those encoding functions into one
of the MacVim source files, or I'll have to rely on Cocoa for
conversion routines.

Now, I don't mind doing this too much, but at the moment I don't
understand the issues you are having, so I can't come up with any
better suggestions (but to me it seems unnecessary to have to poke
around in MacVim).  Well, I did already say that things would be
better if the encoding functions were to reside in a source file that
I can include in MacVim (i.e. not gui_mac.c).


/Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui