Hello Everybody,

I fixed this problem with a simple patch. I also had to add something to
the Makefile. I decided to separate the Vim source tree patches related
to CodeCheck from the direct code_check.c patches. That is why I am
attaching two files. Please let me know if this is not a good idea, or
there is another common way of doing it. I will fix it accordingly.

Regards,

On Mon, Dec 08, 2008 at 08:37:11AM +0100, Markus Heidelberg wrote:
> 
> Birgi Tamersoy, 08.12.2008:
> > 
> > Hello Markus,
> > 
> > On Mon, Dec 08, 2008 at 01:10:20AM +0100, Markus Heidelberg wrote:
> > > 
> > > Richard Hartmann, 07.12.2008:
> > > > Hi all,
> > > > 
> > > > building vim_extended with the code checker patch fails:
> > > > 
> > > > code_check.c:315: error: 'gui' undeclared (first use in this function)
> > > > code_check.c:364: error: 'gui' undeclared (first use in this function)
> > > 
> > > FEAT_GUI is not defined, so gui.h is not included and gui_T gui is
> > > unknown. Some #ifdef FEAT_GUI are required. Doesn't configure find GTK
> > > or so? See vim.h line 100.
> > > 
> > Thanks for pointing out the problem. The fix seems to be easy, I will try to
> > make it tonight (or sometime tomorrow).
> 
> Yes, it's easy. I wanted to do it myself, but waited when I saw your
> reply on the list and noticed that the if at the second error should be
> inverted for cleaner #ifdef-ing.
> 
> > > Birgi, is the codecheck project still active? There are no new
> > > commits/patches on the Google Code project site since your announcement
> > > on the list.
> > > 
> > Yes, it is active, but unfortunately I am having a very hard time to
> > work on it during the semester. In 10 days I will have a break for a
> > couple of weeks. During that time I am planning to add a few more
> > things.
> 
> I thought so. That's probably the same for everyone.
> 
> Markus
> 
> 
> > 

-- 
Birgi

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

--- ../../codecheck/code_check.c        2008-12-08 10:27:05.000000000 -0600
+++ code_check.c        2008-12-08 10:59:10.000000000 -0600
@@ -312,8 +312,10 @@
 
        /* when gui mode is used, an other update screen is required. */
        /*                                  i don't know why :)!!!. */
+#ifdef FEAT_GUI
        if (gui.in_use)
            cc_update_screen();
+#endif
 
        /* find the buffer line */
 
@@ -361,7 +363,9 @@
  */
     void
 cc_update_screen(void) {
+#ifdef FEAT_GUI
     if (!gui.in_use) {
+#endif
        /* in console mode updating the screen from the worker thread
         * does not cause any problems. */
        update_topline();
@@ -370,6 +374,7 @@
        setcursor();
        cursor_on();
        out_flush();
+#ifdef FEAT_GUI
     } else {
        /* updating the screen in gui mode is troublesome. */
        char_u  bytes[3];
@@ -380,6 +385,7 @@
 
        add_to_input_buf(bytes, 3);
     }
+#endif
 }
 
 /*
@@ -485,6 +491,7 @@
 cc_compile_tmp_copy(cc_bufline_T *bufline, char_u *tmp_copy_ffname, 
        int copy_type) {
     char_u     cmd[MAX_CMD_LENGTH];
+    int                retval;
 
     if (bufline->buf_compile_cmd[0] == NUL)
        return CC_FAIL;
@@ -497,7 +504,9 @@
     sprintf((char *)cmd, "%s > %s.out 2>&1", 
            (char *)bufline->buf_compile_cmd, (char *)tmp_copy_ffname);
 #if 1    
-    system((char *)cmd);
+    retval = system((char *)cmd);
+    if (retval < 0)
+       return CC_FAIL;
 #endif
 
     return CC_SUCCESS;
@@ -517,7 +526,9 @@
            cc_set_tmp_copy_ffname(buf, tmp_copy_ffname);
            sprintf((char *)cmd, "touch %s", (char *)tmp_copy_ffname);
     
-           system((char *)cmd);
+           retval = system((char *)cmd);
+           if (retval < 0)
+               return CC_FAIL;
 #if 1
            retval = buf_write(buf, tmp_copy_ffname, NULL,
                    (linenr_T) 1, buf->b_ml.ml_line_count, NULL, 
--- Makefile_ori        2008-12-08 11:45:47.000000000 -0600
+++ Makefile    2008-12-08 11:45:56.000000000 -0600
@@ -1363,6 +1363,9 @@
 
 TAGS_INCL = *.h
 
+# CodeCheck requires the pthreads library.
+EXTRA_LIBS = -lpthread
+
 BASIC_SRC = \
        buffer.c \
        charset.c \

Raspunde prin e-mail lui