hgomez      2002/06/21 08:28:56

  Modified:    jk/native/common jk_ajp14_worker.h jk_global.h jk_util.c
  Log:
  fix the vsnprintf and snprintf
  Just define USE_SPRINT and USE_VSPRINTF when you didn't have
  these on your OS (ie Solaris 2.5)
  
  Revision  Changes    Path
  1.7       +1 -6      jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.h
  
  Index: jk_ajp14_worker.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_ajp14_worker.h 4 Dec 2001 19:48:41 -0000       1.6
  +++ jk_ajp14_worker.h 21 Jun 2002 15:28:56 -0000      1.7
  @@ -80,11 +80,6 @@
   
   #define JK_AJP14_WORKER_NAME ("ajp14")
   
  -#ifdef WIN32
  -/* define snprint to match windows version */
  -#define snprintf _snprintf
  -#endif
  -
   int JK_METHOD ajp14_worker_factory(jk_worker_t **w,
                                      const char *name,
                                      jk_logger_t *l);
  
  
  
  1.18      +10 -1     jakarta-tomcat-connectors/jk/native/common/jk_global.h
  
  Index: jk_global.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_global.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- jk_global.h       3 May 2002 05:39:58 -0000       1.17
  +++ jk_global.h       21 Jun 2002 15:28:56 -0000      1.18
  @@ -197,6 +197,15 @@
   #ifdef WIN32
   /* For WIN32, emulate gettimeofday() using _ftime() */
   #define gettimeofday(tv,tz) { struct _timeb tb; _ftime(&tb); (tv)->tv_sec = 
tb.time; (tv)->tv_usec = tb.millitm * 1000; }
  +/* define snprint to match windows version */
  +#define snprintf _snprintf
  +/* define vsnprint to match windows version */
  +#define vsnprintf _vsnprintf
  +#endif
  +
  +#ifdef NETWARE
  +#define USE_SPRINTF
  +#define USE_VSPRINTF
   #endif
   
   #ifdef __cplusplus
  
  
  
  1.15      +5 -11     jakarta-tomcat-connectors/jk/native/common/jk_util.c
  
  Index: jk_util.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_util.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- jk_util.c 15 May 2002 21:00:29 -0000      1.14
  +++ jk_util.c 21 Jun 2002 15:28:56 -0000      1.15
  @@ -237,16 +237,12 @@
               f++;
           }
   
  -#ifdef WIN32
  -     set_time_str(buf, HUGE_BUFFER_SIZE);
  -     used = strlen(buf);
  -        if(line)
  -            used += _snprintf(&buf[used], HUGE_BUFFER_SIZE, " [%s (%d)]: ", f, 
line);        
  -#elif defined(NETWARE) /* until we get a snprintf function */
  +#ifdef USE_SPRINTF /* until we get a snprintf function */
  +#ifdef NETWARE
           buf = (char *) malloc(HUGE_BUFFER_SIZE);
           if (NULL == buf)
              return -1;
  -
  +#endif
        set_time_str(buf, HUGE_BUFFER_SIZE);
        used = strlen(buf);
           if(line)
  @@ -262,9 +258,7 @@
           }
       
           va_start(args, fmt);
  -#ifdef WIN32
  -        rc = _vsnprintf(buf + used, HUGE_BUFFER_SIZE - used, fmt, args);
  -#elif defined(NETWARE) /* until we get a vsnprintf function */
  +#ifdef USE_VSPRINTF /* until we get a vsnprintf function */
           rc = vsprintf(buf + used, fmt, args);
   #else 
           rc = vsnprintf(buf + used, HUGE_BUFFER_SIZE - used, fmt, args);
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to