]> git.proxmox.com Git - mirror_edk2.git/commitdiff
StdLib: Revise the meaning of several feature macros.
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 3 Nov 2011 00:01:24 +0000 (00:01 +0000)
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 3 Nov 2011 00:01:24 +0000 (00:01 +0000)
Feature macros, defined in StdLibPrivateInternalFiles/Include/LibConfig.h are defined to cause the named feature to be included.  When originally added, several features were guarded using reversed logic.

Signed-off-by: darylm503
Reviewed-by: geekboy15a
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12652 6f19259b-4bc3-4df7-8a09-765794883524

StdLib/LibC/StdLib/setprogname.c
StdLib/LibC/Time/gettimeofday.c
StdLib/LibC/Uefi/compat.c
StdLibPrivateInternalFiles/Include/LibConfig.h

index 3f2bc53cd577adffdbbbf303b14e3dadd057d2bf..24198cb9bb5c5ced8236cf47476f0939af8d676f 100644 (file)
@@ -40,7 +40,7 @@
  */\r
 #include  <LibConfig.h>\r
 \r
-#ifndef HAVE_SETPROGNAME\r
+#ifdef HAVE_SETPROGNAME\r
 #include <string.h>\r
 \r
 static const char *__progname = NULL;\r
index 1de6dfa66fcdf880f7fcd885ae1767454ae10b5d..d54b7bcf7c06cf805212fbb91f53b80caa629380 100644 (file)
@@ -48,9 +48,9 @@
 #include <sys/EfiCdefs.h>\r
 #include <sys/time.h>\r
 #include <time.h>\r
-#ifndef HAVE_GETTIMEOFDAY\r
 \r
 \r
+#ifdef HAVE_GETTIMEOFDAY\r
 /*\r
  * Simple gettimeofday that only returns seconds.\r
  */\r
index 8ce4783a6a518ab17ed2fd5844fa0e70f3ac9d1e..251863fb140a036940b2e390bdd3edb618bc1640 100644 (file)
@@ -134,16 +134,15 @@ getopt(int argc, char **argv, char *args)
                         }\r
                 }\r
         }\r
-\r
         return -1;\r
 }\r
 #endif\r
 \r
 #define ISPATHSEPARATOR(x) ((x == '/') || (x == '\\'))\r
 \r
-#ifndef HAVE_BASENAME\r
+#ifdef HAVE_BASENAME\r
 #ifndef PATH_MAX\r
-#define PATH_MAX 5000\r
+  #define PATH_MAX 5000\r
 #endif\r
 \r
 char *\r
@@ -232,7 +231,7 @@ mkstemp(char *path)
 }\r
 #endif\r
 \r
-#ifndef HAVE_FFS\r
+#ifdef HAVE_FFS\r
 int\r
 ffs(int x)\r
 {\r
index d925ac3258b231c9f610ec425600b912a7ae8b46..c0299b312c7a221392241d2edaf7f47a8459f8e6 100644 (file)
 /* Define these if the associated file exists. */\r
 //#define HAVE_NBTOOL_CONFIG_H\r
 \r
-/* Define these if StdLib provides the functionality as opposed to a "compatibility" library */\r
 \r
+/* Define these macros in order to enable the associated functions. */\r
+#define HAVE_BASENAME\r
+#define HAVE_FFS\r
+#define HAVE_GETTIMEOFDAY\r
+#define HAVE_DIRNAME\r
+#define HAVE_SETPROGNAME  1\r
+\r
+\r
+/* Define these if StdLib provides the functionality as opposed to a "compatibility" library */\r
 //#define HAVE_GETOPT\r
-//#define HAVE_BASENAME\r
-//#define HAVE_FFS\r
-//#define HAVE_GETTIMEOFDAY\r
-//#define HAVE_SETPROGNAME  0\r
 //#define HAVE_STRLCPY\r
 //#define HAVE_STRLCAT\r
-//#define HAVE_DIRNAME\r
 #define HAVE_MKSTEMP\r
 #define HAVE_SNPRINTF\r
 #define HAVE_VSNPRINTF\r