Mercurial > projects > ldc
view dmd2/root/gnuc.c @ 1627:e83f0778c260
Merge DMD r321: bugzilla 3575 CTFE: member structs not initialized correctly
---
dmd/expression.c | 4 +---
dmd/interpret.c | 32 +++++++++-----------------------
dmd/mtype.c | 48 +++++++++++++++++++++++++++++++++++++++++++-----
dmd/mtype.h | 2 ++
4 files changed, 55 insertions(+), 31 deletions(-)
author | Leandro Lucarella <llucax@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 15:18:23 -0300 |
parents | 638d16625da2 |
children |
line wrap: on
line source
// Put functions in here missing from gnu C #include "gnuc.h" int memicmp(const char *s1, const char *s2, int n) { int result = 0; for (int i = 0; i < n; i++) { char c1 = s1[i]; char c2 = s2[i]; result = c1 - c2; if (result) { if ('A' <= c1 && c1 <= 'Z') c1 += 'a' - 'A'; if ('A' <= c2 && c2 <= 'Z') c2 += 'a' - 'A'; result = c1 - c2; if (result) break; } } return result; } int stricmp(const char *s1, const char *s2) { int result = 0; for (;;) { char c1 = *s1; char c2 = *s2; result = c1 - c2; if (result) { if ('A' <= c1 && c1 <= 'Z') c1 += 'a' - 'A'; if ('A' <= c2 && c2 <= 'Z') c2 += 'a' - 'A'; result = c1 - c2; if (result) break; } if (!c1) break; s1++; s2++; } return result; }