This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Build failure on Linux - strnicmp undefined


Thanks folks.  This works.
I will check it in momentarily.


* p-exp.y: Define strncasecmp as strnicmp for MSVC.
  (yylex): Use strncasecmp, not strnicmp.


Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.2
diff -c -p -r1.2 p-exp.y
*** p-exp.y     2000/12/01 10:40:10     1.2
--- p-exp.y     2000/12/01 19:58:57
*************** Foundation, Inc., 59 Temple Place - Suit
*** 58,63 ****
--- 58,68 ----
  #include "symfile.h" /* Required by objfiles.h.  */
  #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
  
+ /* MSVC uses strnicmp instead of strncasecmp */
+ #ifdef _MSC_VER
+ #define strncasecmp strnicmp
+ #endif
+ 
  /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
     as well as gratuitiously global symbol names, so we can have multiple
     yacc generated parsers in gdb.  Note that these are only the variables
*************** yylex ()
*** 953,959 ****
    /* See if it is a special token of length 3.  */
    if (explen > 2)
      for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
!       if (strnicmp (tokstart, tokentab3[i].operator, 3) == 0
            && (!isalpha (tokentab3[i].operator[0]) || explen == 3
                || (!isalpha (tokstart[3]) && !isdigit (tokstart[3]) && tokstart[3] != '_')))
          {
--- 958,964 ----
    /* See if it is a special token of length 3.  */
    if (explen > 2)
      for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
!       if (strncasecmp (tokstart, tokentab3[i].operator, 3) == 0
            && (!isalpha (tokentab3[i].operator[0]) || explen == 3
                || (!isalpha (tokstart[3]) && !isdigit (tokstart[3]) && tokstart[3] != '_')))
          {
*************** yylex ()
*** 965,971 ****
    /* See if it is a special token of length 2.  */
    if (explen > 1)
    for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
!       if (strnicmp (tokstart, tokentab2[i].operator, 2) == 0
            && (!isalpha (tokentab2[i].operator[0]) || explen == 2
                || (!isalpha (tokstart[2]) && !isdigit (tokstart[2]) && tokstart[2] != '_')))
          {
--- 970,976 ----
    /* See if it is a special token of length 2.  */
    if (explen > 1)
    for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
!       if (strncasecmp (tokstart, tokentab2[i].operator, 2) == 0
            && (!isalpha (tokentab2[i].operator[0]) || explen == 2
                || (!isalpha (tokstart[2]) && !isdigit (tokstart[2]) && tokstart[2] != '_')))
          {


-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]