Fossil SCM
Fix the build for MSVC.
Commit
732b651afa972588c83e80f9fa213770c6e8f5cb
Parent
df302de88a4c54b…
2 files changed
+5
-1
+2
-2
+5
-1
| --- src/piechart.c | ||
| +++ src/piechart.c | ||
| @@ -20,10 +20,14 @@ | ||
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "piechart.h" |
| 23 | 23 | #include <math.h> |
| 24 | 24 | |
| 25 | +#ifndef M_PI | |
| 26 | +# define M_PI 3.1415926535897932385 | |
| 27 | +#endif | |
| 28 | + | |
| 25 | 29 | /* |
| 26 | 30 | ** Return an RGB color name given HSV values. The HSV values |
| 27 | 31 | ** must each be between between 0 and 255. The string |
| 28 | 32 | ** returned is held in a static buffer and is overwritten |
| 29 | 33 | ** on each call. |
| @@ -208,15 +212,15 @@ | ||
| 208 | 212 | */ |
| 209 | 213 | void piechart_test_page(void){ |
| 210 | 214 | const char *zData; |
| 211 | 215 | Stmt ins, q; |
| 212 | 216 | Blob all, line, token1, token2; |
| 213 | - login_check_credentials(); | |
| 214 | 217 | int n = 0; |
| 215 | 218 | int width; |
| 216 | 219 | int height; |
| 217 | 220 | |
| 221 | + login_check_credentials(); | |
| 218 | 222 | style_header("Pie Chart Test"); |
| 219 | 223 | db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);"); |
| 220 | 224 | db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)"); |
| 221 | 225 | zData = PD("data",""); |
| 222 | 226 | width = atoi(PD("width","800")); |
| 223 | 227 |
| --- src/piechart.c | |
| +++ src/piechart.c | |
| @@ -20,10 +20,14 @@ | |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "piechart.h" |
| 23 | #include <math.h> |
| 24 | |
| 25 | /* |
| 26 | ** Return an RGB color name given HSV values. The HSV values |
| 27 | ** must each be between between 0 and 255. The string |
| 28 | ** returned is held in a static buffer and is overwritten |
| 29 | ** on each call. |
| @@ -208,15 +212,15 @@ | |
| 208 | */ |
| 209 | void piechart_test_page(void){ |
| 210 | const char *zData; |
| 211 | Stmt ins, q; |
| 212 | Blob all, line, token1, token2; |
| 213 | login_check_credentials(); |
| 214 | int n = 0; |
| 215 | int width; |
| 216 | int height; |
| 217 | |
| 218 | style_header("Pie Chart Test"); |
| 219 | db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);"); |
| 220 | db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)"); |
| 221 | zData = PD("data",""); |
| 222 | width = atoi(PD("width","800")); |
| 223 |
| --- src/piechart.c | |
| +++ src/piechart.c | |
| @@ -20,10 +20,14 @@ | |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "piechart.h" |
| 23 | #include <math.h> |
| 24 | |
| 25 | #ifndef M_PI |
| 26 | # define M_PI 3.1415926535897932385 |
| 27 | #endif |
| 28 | |
| 29 | /* |
| 30 | ** Return an RGB color name given HSV values. The HSV values |
| 31 | ** must each be between between 0 and 255. The string |
| 32 | ** returned is held in a static buffer and is overwritten |
| 33 | ** on each call. |
| @@ -208,15 +212,15 @@ | |
| 212 | */ |
| 213 | void piechart_test_page(void){ |
| 214 | const char *zData; |
| 215 | Stmt ins, q; |
| 216 | Blob all, line, token1, token2; |
| 217 | int n = 0; |
| 218 | int width; |
| 219 | int height; |
| 220 | |
| 221 | login_check_credentials(); |
| 222 | style_header("Pie Chart Test"); |
| 223 | db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);"); |
| 224 | db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)"); |
| 225 | zData = PD("data",""); |
| 226 | width = atoi(PD("width","800")); |
| 227 |
+2
-2
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -379,16 +379,16 @@ | ||
| 379 | 379 | ** |
| 380 | 380 | ** Show relative sizes of tables in the repository database. |
| 381 | 381 | */ |
| 382 | 382 | void repo_tabsize_page(void){ |
| 383 | 383 | Stmt q; |
| 384 | - login_check_credentials(); | |
| 385 | 384 | int nPageFree; |
| 386 | 385 | sqlite3_int64 fsize; |
| 387 | 386 | char zBuf[100]; |
| 388 | - if( !g.perm.Read ){ login_needed(g.anon.Read); return; } | |
| 389 | 387 | |
| 388 | + login_check_credentials(); | |
| 389 | + if( !g.perm.Read ){ login_needed(g.anon.Read); return; } | |
| 390 | 390 | style_header("Repository Table Sizes"); |
| 391 | 391 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 392 | 392 | style_submenu_element("Stat", "Repository Stats", "stat"); |
| 393 | 393 | db_multi_exec( |
| 394 | 394 | "CREATE VIRTUAL TABLE temp.dbx USING dbstat(%s);" |
| 395 | 395 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -379,16 +379,16 @@ | |
| 379 | ** |
| 380 | ** Show relative sizes of tables in the repository database. |
| 381 | */ |
| 382 | void repo_tabsize_page(void){ |
| 383 | Stmt q; |
| 384 | login_check_credentials(); |
| 385 | int nPageFree; |
| 386 | sqlite3_int64 fsize; |
| 387 | char zBuf[100]; |
| 388 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 389 | |
| 390 | style_header("Repository Table Sizes"); |
| 391 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 392 | style_submenu_element("Stat", "Repository Stats", "stat"); |
| 393 | db_multi_exec( |
| 394 | "CREATE VIRTUAL TABLE temp.dbx USING dbstat(%s);" |
| 395 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -379,16 +379,16 @@ | |
| 379 | ** |
| 380 | ** Show relative sizes of tables in the repository database. |
| 381 | */ |
| 382 | void repo_tabsize_page(void){ |
| 383 | Stmt q; |
| 384 | int nPageFree; |
| 385 | sqlite3_int64 fsize; |
| 386 | char zBuf[100]; |
| 387 | |
| 388 | login_check_credentials(); |
| 389 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 390 | style_header("Repository Table Sizes"); |
| 391 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 392 | style_submenu_element("Stat", "Repository Stats", "stat"); |
| 393 | db_multi_exec( |
| 394 | "CREATE VIRTUAL TABLE temp.dbx USING dbstat(%s);" |
| 395 |