git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 02/17] boolean is a typedef under MSVC, so rename variable to 'i_boolean'

From
Marius Storm-Olsen <mstormo@gmail.com>
Date
Sep 14, 2009, 13:11 UTC
Message-ID
<7786dfa1b74b5c4974bcf2018d3991c215a9466f.1252925290.git.mstormo@gmail.com>
In-Reply-To
<1b36d8e041c9c1a6dc68f9cc3919fcf91b7a9ac6.1252925290.git.mstormo@gmail.com>

With MSVC 'boolean' is already a typedef to unsigned char in the rpcndr.h in the SDK. So, just rename to 'i_boolean' to avoid conflicts in this one file, instead of any include magic.

Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com>
---
 test-parse-options.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/test-parse-options.c b/test-parse-options.c
index efa734b..0c2d327 100644
--- a/test-parse-options.c
+++ b/test-parse-options.c
@@ -1,7 +1,7 @@
 #include "cache.h"
 #include "parse-options.h"
 
-static int boolean = 0;
+static int i_boolean = 0;
 static int integer = 0;
 static unsigned long timestamp;
 static int abbrev = 7;
@@ -34,10 +34,10 @@ int main(int argc, const char **argv)
 		NULL
 	};
 	struct option options[] = {
-		OPT_BOOLEAN('b', "boolean", &boolean, "get a boolean"),
-		OPT_BIT('4', "or4", &boolean,
+		OPT_BOOLEAN('b', "boolean", &i_boolean, "get a boolean"),
+		OPT_BIT('4', "or4", &i_boolean,
 			"bitwise-or boolean with ...0100", 4),
-		OPT_NEGBIT(0, "neg-or4", &boolean, "same as --no-or4", 4),
+		OPT_NEGBIT(0, "neg-or4", &i_boolean, "same as --no-or4", 4),
 		OPT_GROUP(""),
 		OPT_INTEGER('i', "integer", &integer, "get a integer"),
 		OPT_INTEGER('j', NULL, &integer, "get a integer, too"),
@@ -57,7 +57,7 @@ int main(int argc, const char **argv)
 		OPT_ARGUMENT("quux", "means --quux"),
 		OPT_NUMBER_CALLBACK(&integer, "set integer to NUM",
 			number_callback),
-		{ OPTION_BOOLEAN, '+', NULL, &boolean, NULL, "same as -b",
+		{ OPTION_BOOLEAN, '+', NULL, &i_boolean, NULL, "same as -b",
 		  PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_NODASH },
 		OPT_GROUP("Standard options"),
 		OPT__ABBREV(&abbrev),
@@ -70,7 +70,7 @@ int main(int argc, const char **argv)
 
 	argc = parse_options(argc, argv, prefix, options, usage, 0);
 
-	printf("boolean: %d\n", boolean);
+	printf("boolean: %d\n", i_boolean);
 	printf("integer: %u\n", integer);
 	printf("timestamp: %lu\n", timestamp);
 	printf("string: %s\n", string ? string : "(not set)");
-- 
1.6.2.1.418.g33d56.dirty
Previous: Marius Storm-OlsenNext: Marius Storm-Olsen
Message 3 of 35 in “Build Git with MSVC”
  1. 00/17 Build Git with MSVCMarius Storm-Olsen, Sep 14, 2009
  2. 01/17 Avoid declaration after statementMarius Storm-Olsen, Sep 14, 2009
  3. 02/17 boolean is a typedef under MSVC, so rename variable to 'i_boolean'Marius Storm-Olsen, Sep 14, 2009
  4. 03/17 Define SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++Marius Storm-Olsen, Sep 14, 2009
  5. 04/17 Add define guards to compat/win32.hMarius Storm-Olsen, Sep 14, 2009
  6. 05/17 Change regerror() declaration from K&R style to ANSI C (C89)Marius Storm-Olsen, Sep 14, 2009
  7. 06/17 mingw.c: Use the O_BINARY flag to open filesMarius Storm-Olsen, Sep 14, 2009
  8. 07/17 Fix __stdcall/WINAPI placement and function prototypeMarius Storm-Olsen, Sep 14, 2009
  9. 08/17 Test for WIN32 instead of __MINGW32_Marius Storm-Olsen, Sep 14, 2009
  10. 09/17 Add empty header files for MSVC portMarius Storm-Olsen, Sep 14, 2009
  11. 10/17 Add MinGW header files to build git with MSVCMarius Storm-Olsen, Sep 14, 2009
  12. 11/17 Add platform files for MSVC portingMarius Storm-Olsen, Sep 14, 2009
  13. 12/17 Make usage of windows.h lean and meanMarius Storm-Olsen, Sep 14, 2009
  14. 13/17 Define strncasecmp as _strnicmp for MSVCMarius Storm-Olsen, Sep 14, 2009
  15. 14/17 Add ftruncate implementation for MSVCMarius Storm-Olsen, Sep 14, 2009
  16. 15/17 Add MSVC to MakefileMarius Storm-Olsen, Sep 14, 2009
  17. 16/17 Add README for MSVC buildMarius Storm-Olsen, Sep 14, 2009
  18. 17/17 Add scripts to generate projects for other buildsystems (MSVC vcproj, QMake)Marius Storm-Olsen, Sep 14, 2009
  19. Alex RiesenSep 14, 2009
  20. Marius Storm-OlsenSep 14, 2009
  21. Alex RiesenSep 14, 2009
  22. Marius Storm-OlsenSep 14, 2009
  23. Junio C HamanoSep 14, 2009
  24. Junio C HamanoSep 14, 2009
  25. Marius Storm-OlsenSep 14, 2009
  26. Johannes SixtSep 14, 2009
  27. Johannes SchindelinSep 15, 2009
  28. Marius Storm-OlsenSep 15, 2009
  29. Alexey BorzenkovSep 14, 2009
  30. Marius Storm-OlsenSep 14, 2009
  31. Alex RiesenSep 14, 2009
  32. Marius Storm-OlsenSep 14, 2009
  33. Frank LiSep 14, 2009
  34. Alex RiesenSep 14, 2009
  35. Marius Storm-OlsenSep 14, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.