浏览代码

Fix warning about macro redefinition

Fixes this:

libc/misc/internals/tempname.c: In function 'brain_damaged_fillrand':
libc/misc/internals/tempname.c:155:0: warning: "L" redefined
 #define L ((UINT32_MAX % NUM_LETTERS + 1) % NUM_LETTERS)

In file included from ./libpthread/nptl/sysdeps/unix/sysv/linux/lowlevellock.h:24:0,
                 from ./include/bits/libc-lock.h:35,
                 from ./include/bits/stdio-lock.h:22,
                 from ./include/bits/uClibc_mutex.h:73,
                 from ./include/bits/uClibc_stdio.h:83,
                 from ./include/stdio.h:71,
                 from libc/misc/internals/tempname.c:35:
./libc/sysdeps/linux/kvx/sysdep.h:40:0: note: this is the location of the previous definition
 #  define L(name) $L##name

Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
Yann Sionneau 4 年之前
父节点
当前提交
b1c3d18204
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      libc/misc/internals/tempname.c

+ 6 - 6
libc/misc/internals/tempname.c

@@ -152,12 +152,12 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len)
 	for (i = 0; i < len; ++i) {
 	for (i = 0; i < len; ++i) {
 		rh = high % NUM_LETTERS;
 		rh = high % NUM_LETTERS;
 		high /= NUM_LETTERS;
 		high /= NUM_LETTERS;
-#define L ((UINT32_MAX % NUM_LETTERS + 1) % NUM_LETTERS)
+#define _L ((UINT32_MAX % NUM_LETTERS + 1) % NUM_LETTERS)
-		k = (low % NUM_LETTERS) + (L * rh);
+		k = (low % NUM_LETTERS) + (_L * rh);
-#undef L
+#undef _L
-#define H ((UINT32_MAX / NUM_LETTERS) + ((UINT32_MAX % NUM_LETTERS + 1) / NUM_LETTERS))
+#define _H ((UINT32_MAX / NUM_LETTERS) + ((UINT32_MAX % NUM_LETTERS + 1) / NUM_LETTERS))
-		low = (low / NUM_LETTERS) + (H * rh) + (k / NUM_LETTERS);
+		low = (low / NUM_LETTERS) + (_H * rh) + (k / NUM_LETTERS);
-#undef H
+#undef _H
 		k %= NUM_LETTERS;
 		k %= NUM_LETTERS;
 		buf[i] = letters[k];
 		buf[i] = letters[k];
 	}
 	}