]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Visual Studio 2015 build fixes
authorThomas Sondergaard <thomas.sondergaard@karoshealth.com>
Sat, 8 Aug 2015 15:21:28 +0000 (17:21 +0200)
committerGreg Hudson <ghudson@mit.edu>
Mon, 10 Aug 2015 17:22:50 +0000 (13:22 -0400)
Define HAVE_VSNPRINTF for VS2015 or newer.  Avoid putting constants
directly after string literals without whitespace, or the VS2015
compiler thinks it's a string suffix.  Prefix the OVERFLOW identifier
in x-deltat.y (along with NUM and LONGNUM for consistency) to avoid a
conflict with math.h.  Regenerate deltat.c.

[ghudson@mit.edu: squashed three commits and condensed commit
messages; avoid creating long lines]

ticket: 8231

src/include/win-mac.h
src/lib/krb5/krb/deltat.c
src/lib/krb5/krb/x-deltat.y
src/windows/leash/Leash.cpp

index 2d8090adbf62921dc1fe34893efeaad342f185bf..1994388b71d3502929a85ef11457f75f6b6511be 100644 (file)
@@ -119,6 +119,9 @@ typedef _W64 int         ssize_t;
 #define NO_PASSWORD
 #define HAVE_STRERROR
 #define SYS_ERRLIST_DECLARED
+#if _MSC_VER >= 1900
+#define HAVE_VSNPRINTF
+#endif
 /* Visual Studio 2012 errors out when we macroize keywords in C++ mode */
 #ifndef __cplusplus
 #define inline __inline
index 0169da8e61dfe141c9748966503f20e4ccff6929..2c8b90b54ce30ceec938155a86e19d23de9d8f7d 100644 (file)
@@ -153,7 +153,7 @@ static int mylex(int *intp, struct param *tmv);
 static int yyparse(struct param *);
 
 
-#line 158 "deltat.c" /* yacc.c:339  */
+#line 157 "deltat.c" /* yacc.c:339  */
 
 # ifndef YY_NULLPTR
 #  if defined __cplusplus && 201103L <= __cplusplus
@@ -185,9 +185,9 @@ extern int yydebug;
 # define YYTOKENTYPE
   enum yytokentype
   {
-    NUM = 258,
-    LONGNUM = 259,
-    OVERFLOW = 260,
+    tok_NUM = 258,
+    tok_LONGNUM = 259,
+    tok_OVERFLOW = 260,
     tok_WS = 261
   };
 #endif
@@ -197,10 +197,10 @@ extern int yydebug;
 typedef union YYSTYPE YYSTYPE;
 union YYSTYPE
 {
-#line 130 "x-deltat.y" /* yacc.c:355  */
+#line 129 "x-deltat.y" /* yacc.c:355  */
 int val;
 
-#line 205 "deltat.c" /* yacc.c:355  */
+#line 204 "deltat.c" /* yacc.c:355  */
 };
 # define YYSTYPE_IS_TRIVIAL 1
 # define YYSTYPE_IS_DECLARED 1
@@ -214,7 +214,7 @@ int yyparse (struct param *tmv);
 
 /* Copy the second part of user declarations.  */
 
-#line 219 "deltat.c" /* yacc.c:358  */
+#line 218 "deltat.c" /* yacc.c:358  */
 
 #ifdef short
 # undef short
@@ -512,8 +512,8 @@ static const yytype_uint8 yytranslate[] =
   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,   144,   144,   145,   145,   146,   146,   147,   147,   148,
-     149,   151,   152,   153,   154,   155,   156,   157,   158,   162,
+       0,   143,   143,   144,   144,   145,   145,   146,   146,   147,
+     148,   150,   151,   152,   153,   154,   155,   156,   157,   162,
      163,   166,   167,   170,   171
 };
 #endif
@@ -523,8 +523,8 @@ static const yytype_uint8 yyrline[] =
    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
-  "$end", "error", "$undefined", "NUM", "LONGNUM", "OVERFLOW", "'-'",
-  "':'", "'d'", "'h'", "'m'", "'s'", "tok_WS", "$accept", "start",
+  "$end", "error", "$undefined", "tok_NUM", "tok_LONGNUM", "tok_OVERFLOW",
+  "'-'", "':'", "'d'", "'h'", "'m'", "'s'", "tok_WS", "$accept", "start",
   "posnum", "num", "ws", "wsnum", "deltat", "opt_hms", "opt_ms", "opt_s", YY_NULLPTR
 };
 #endif
@@ -1310,93 +1310,93 @@ yyreduce:
   switch (yyn)
     {
         case 6:
-#line 146 "x-deltat.y" /* yacc.c:1646  */
+#line 145 "x-deltat.y" /* yacc.c:1646  */
     { (yyval.val) = - (yyvsp[0].val); }
-#line 1317 "deltat.c" /* yacc.c:1646  */
+#line 1316 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 9:
-#line 148 "x-deltat.y" /* yacc.c:1646  */
+#line 147 "x-deltat.y" /* yacc.c:1646  */
     { (yyval.val) = (yyvsp[0].val); }
-#line 1323 "deltat.c" /* yacc.c:1646  */
+#line 1322 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 10:
-#line 149 "x-deltat.y" /* yacc.c:1646  */
+#line 148 "x-deltat.y" /* yacc.c:1646  */
     { YYERROR; }
-#line 1329 "deltat.c" /* yacc.c:1646  */
+#line 1328 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 11:
-#line 151 "x-deltat.y" /* yacc.c:1646  */
+#line 150 "x-deltat.y" /* yacc.c:1646  */
     { DO ((yyvsp[-2].val),  0,  0, (yyvsp[0].val)); }
-#line 1335 "deltat.c" /* yacc.c:1646  */
+#line 1334 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 12:
-#line 152 "x-deltat.y" /* yacc.c:1646  */
+#line 151 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0, (yyvsp[-2].val),  0, (yyvsp[0].val)); }
-#line 1341 "deltat.c" /* yacc.c:1646  */
+#line 1340 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 13:
-#line 153 "x-deltat.y" /* yacc.c:1646  */
+#line 152 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0,  0, (yyvsp[-2].val), (yyvsp[0].val)); }
-#line 1347 "deltat.c" /* yacc.c:1646  */
+#line 1346 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 14:
-#line 154 "x-deltat.y" /* yacc.c:1646  */
+#line 153 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0,  0,  0, (yyvsp[-1].val)); }
-#line 1353 "deltat.c" /* yacc.c:1646  */
+#line 1352 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 15:
-#line 155 "x-deltat.y" /* yacc.c:1646  */
+#line 154 "x-deltat.y" /* yacc.c:1646  */
     { DO ((yyvsp[-6].val), (yyvsp[-4].val), (yyvsp[-2].val), (yyvsp[0].val)); }
-#line 1359 "deltat.c" /* yacc.c:1646  */
+#line 1358 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 16:
-#line 156 "x-deltat.y" /* yacc.c:1646  */
+#line 155 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0, (yyvsp[-4].val), (yyvsp[-2].val), (yyvsp[0].val)); }
-#line 1365 "deltat.c" /* yacc.c:1646  */
+#line 1364 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 17:
-#line 157 "x-deltat.y" /* yacc.c:1646  */
+#line 156 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0, (yyvsp[-2].val), (yyvsp[0].val),  0); }
-#line 1371 "deltat.c" /* yacc.c:1646  */
+#line 1370 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 18:
-#line 158 "x-deltat.y" /* yacc.c:1646  */
+#line 157 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0,  0,  0, (yyvsp[0].val)); }
-#line 1377 "deltat.c" /* yacc.c:1646  */
+#line 1376 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 20:
 #line 163 "x-deltat.y" /* yacc.c:1646  */
     { if (HOUR_NOT_OK((yyvsp[-2].val))) YYERROR;
                                          DO_SUM((yyval.val), (yyvsp[-2].val) * 3600, (yyvsp[0].val)); }
-#line 1384 "deltat.c" /* yacc.c:1646  */
+#line 1383 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 22:
 #line 167 "x-deltat.y" /* yacc.c:1646  */
     { if (MIN_NOT_OK((yyvsp[-2].val))) YYERROR;
                                          DO_SUM((yyval.val), (yyvsp[-2].val) * 60, (yyvsp[0].val)); }
-#line 1391 "deltat.c" /* yacc.c:1646  */
+#line 1390 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 23:
 #line 170 "x-deltat.y" /* yacc.c:1646  */
     { (yyval.val) = 0; }
-#line 1397 "deltat.c" /* yacc.c:1646  */
+#line 1396 "deltat.c" /* yacc.c:1646  */
     break;
 
 
-#line 1401 "deltat.c" /* yacc.c:1646  */
+#line 1400 "deltat.c" /* yacc.c:1646  */
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -1664,14 +1664,14 @@ mylex(int *intp, struct param *tmv)
        num = c - '0';
        while (isdigit ((int) *P)) {
          if (num > MAX_TIME / 10)
-           return OVERFLOW;
+           return tok_OVERFLOW;
            num *= 10;
            if (num > MAX_TIME - (*P - '0'))
-             return OVERFLOW;
+             return tok_OVERFLOW;
            num += *P++ - '0';
        }
        *intp = num;
-       return (P - orig_p > 2) ? LONGNUM : NUM;
+       return (P - orig_p > 2) ? tok_LONGNUM : tok_NUM;
     case ' ':
     case '\t':
     case '\n':
index 0fb0078ea061fdf4910357a505309977f9b8cdeb..f9cc2bb4695961fb78d3003f1d0132a66c5c47b7 100644 (file)
@@ -131,7 +131,7 @@ static int yyparse(struct param *);
 %lex-param {struct param *tmv}
 %define api.pure
 
-%token <val> NUM LONGNUM OVERFLOW
+%token <val> tok_NUM tok_LONGNUM tok_OVERFLOW
 %token '-' ':' 'd' 'h' 'm' 's' tok_WS
 
 %type <val> num opt_hms opt_ms opt_s wsnum posnum
@@ -141,20 +141,21 @@ static int yyparse(struct param *);
 %%
 
 start: deltat;
-posnum: NUM | LONGNUM ;
+posnum: tok_NUM | tok_LONGNUM ;
 num: posnum | '-' posnum { $$ = - $2; } ;
 ws: /* nothing */ | tok_WS ;
 wsnum: ws num { $$ = $2; }
-        | ws OVERFLOW { YYERROR; };
+        | ws tok_OVERFLOW { YYERROR; };
 deltat:
-         wsnum 'd' opt_hms             { DO ($1,  0,  0, $3); }
-       | wsnum 'h' opt_ms              { DO ( 0, $1,  0, $3); }
-       | wsnum 'm' opt_s               { DO ( 0,  0, $1, $3); }
-       | wsnum 's'                     { DO ( 0,  0,  0, $1); }
-       | wsnum '-' NUM ':' NUM ':' NUM { DO ($1, $3, $5, $7); }
-       | wsnum ':' NUM ':' NUM         { DO ( 0, $1, $3, $5); }
-       | wsnum ':' NUM                 { DO ( 0, $1, $3,  0); }
-       | wsnum                         { DO ( 0,  0,  0, $1); } /* default to 's' */
+         wsnum 'd' opt_hms                          { DO ($1,  0,  0, $3); }
+       | wsnum 'h' opt_ms                           { DO ( 0, $1,  0, $3); }
+       | wsnum 'm' opt_s                            { DO ( 0,  0, $1, $3); }
+       | wsnum 's'                                  { DO ( 0,  0,  0, $1); }
+       | wsnum '-' tok_NUM ':' tok_NUM ':' tok_NUM  { DO ($1, $3, $5, $7); }
+       | wsnum ':' tok_NUM ':' tok_NUM              { DO ( 0, $1, $3, $5); }
+       | wsnum ':' tok_NUM                          { DO ( 0, $1, $3,  0); }
+       | wsnum                                      { DO ( 0,  0,  0, $1); }
+                                                    /* default to 's' */
        ;
 
 opt_hms:
@@ -208,14 +209,14 @@ mylex(int *intp, struct param *tmv)
        num = c - '0';
        while (isdigit ((int) *P)) {
          if (num > MAX_TIME / 10)
-           return OVERFLOW;
+           return tok_OVERFLOW;
            num *= 10;
            if (num > MAX_TIME - (*P - '0'))
-             return OVERFLOW;
+             return tok_OVERFLOW;
            num += *P++ - '0';
        }
        *intp = num;
-       return (P - orig_p > 2) ? LONGNUM : NUM;
+       return (P - orig_p > 2) ? tok_LONGNUM : tok_NUM;
     case ' ':
     case '\t':
     case '\n':
index beead0ce25811139e5184b56c8fabae74604b3fe..f4e7493502385d089a8b23ca73a997f3318dbb20 100644 (file)
@@ -853,8 +853,8 @@ BOOL CLeashApp::InitDLLs()
                  !LoadFuncs(KERB5_PPROFILE_DLL, profile_fi, 0, 0, 1, 0, 0))
         {
             MessageBox(hwnd,
-                       "Unexpected error while loading "KERB5_PPROFILE_DLL".\n"
-                       "Kerberos 5 functionality will be disabled.\n",
+                       "Unexpected error while loading " KERB5_PPROFILE_DLL "."
+                       "\nKerberos 5 functionality will be disabled.\n",
                        "Error", MB_OK);
             AfxFreeLibrary(m_hKrb5ProfileDLL);
             m_hKrb5ProfileDLL = 0;