This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Wed, Oct 6, 2010 at 4:21 AM, Csaba Raduly wrote: > On Sat, Sep 25, 2010 at 12:33 PM, Gwen Morse ?wrote: >>> On Wed, Sep 15, 2010 at 5:46 AM, Gwen Morse ?wrote: >> I'm trying to build tinyfugue with python from source, > (snip) > In line 157 of /usr/include/wchar.h there's the declaration of wprintf. > I suspect there's a > > #define wprintf tf_wprintf > > in Tinyfuge somewhere. This sounds like a bad idea and it finally bit > you: there is no wprintf in wchar.h of Cygwin 1.5, but there *is* one > in Cygwin 1.7 and now it clashes with Tinyfuge's macro. > > I'd suggest removing the wprintf macro in Tinyfuge and manually > replacing all occurrences of wprintf with tf_wprintf. Thank you for your answer, I edited your email address out of the reply above by hand. Recap: I'm having trouble compiling tinyfuge, a mud client, under cygwin 1.7, with an add-on patch that allows the inclusion of a python library. I was getting some error messages, posted them here, and was told it was probably an issue with using "wprinttf" instead of "tf_wprinttf". I understand that much, so, I went back to the tinyfugue source and the python patch and ran the patch with --dry-run to see what would happen. The dry run shows me a bunch of successful-looking "patching" lines. patching file configure patching file configure.in patching file help/commands/python_call.html patching file help/commands/python.html patching file help/commands/python_kill.html patching file help/commands/python_load.html patching file help/topics/tf_module.html patching file help/topics/tf_python.html patching file README.python patching file src/cmdlist.h patching file src/command.c patching file src/command.h patching file src/expr.c patching file src/funclist.h patching file src/main.c patching file src/malloc.c patching file src/socket.c patching file src/tfio.h patching file src/tfpython.c patching file src/tfpython.h patching file src/vars.mak patching file tf-lib/config.py patching file tf-lib/diffedit.py patching file tf-lib/tf4.py patching file tf-lib/tf.py patching file tf-lib/tfutil.py patching file tf-lib/urlwatch.py patching file .tfrc I just wanted to make sure the unedited patch is still good and it looks like it is. So, I opened the patch file, and found these lines: +// wprintf is already in /usr/include/wchar.h, which python includes +#define wprintf tf_wprintf extern void wprintf(const char *fmt, ...) format_printf(1, 2); I removed the top two and left the last (the top looks like a comment but I removed it just to be safe). Then, I also did a search/replace and replaced all "wprinttf" with "tf_wprintf" so, I ended up with: extern void tf_wprintf(const char *fmt, ...) format_printf(1, 2); and then all the other occurrences of wprinttf had tf_ in front of them as well. I get a series of "n of x hunks FAILED" messages when I do a dry run with the edited patch. I also tried keeping the define (thinking maybe tf_wprinttf still needs to be defined). +#define tf_wprintf extern void tf_wprintf(const char *fmt, ...) format_printf(1, 2); I get the same hunks messages at that point. Now it looks like this: $ patch -p 1 -u -N --dry-run < tf-python-patch.txt patching file configure patching file configure.in patching file help/commands/python_call.html patching file help/commands/python.html patching file help/commands/python_kill.html patching file help/commands/python_load.html patching file help/topics/tf_module.html patching file help/topics/tf_python.html patching file README.python patching file src/cmdlist.h patching file src/command.c Hunk #3 FAILED at 524. Hunk #4 FAILED at 532. Hunk #6 FAILED at 591. 3 out of 7 hunks FAILED -- saving rejects to file src/command.c.rej patching file src/command.h patching file src/expr.c patching file src/funclist.h patching file src/main.c patching file src/malloc.c patching file src/socket.c patching file src/tfio.h patch: **** malformed patch at line 696: diff -rNu -x .svn -x config.log -x conf ig.status -x tf-help -x Makefile -x chartables.c -x tfconfig.h -x tfdefs.h -x '* .build' -x '*.bak' -x '*.idx' -x '*.o' -x '*.pyc' -x html2tf -x default -x makeh elp -x tf -x dftables -x 'libpcre*' -x html2tif tf-50b8-clean/src/tfpython.c tf- 50b8-py/src/tfpython.c I'm pretty sure the problem is that I'm editing the original patch incorrectly. I don't really know how to edit patches, *applying* them is as fancy as I get :) . I don't know any C. The original author of the patch does not respond to email. I attached a copy of the patch. I would appreciate any pointers on editing the wprintf macro correctly to tf_wprintf . Alternately, I have another set of source code with the patch pre-applied. Is there a reasonably painless way to edit the already-patched files and change them that way? It just seemed to me that it would be easier to work with one file (the patch) than multiple files (the patched source code). If I need to ask on a different list (because this has turned into a question about C macros) it would really help if someone could point me to a mailing list that would be likely to answer.
Attachment:
tf-python-patch
Description: Binary data
-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |