NO

Author Topic: Problem with malloc.h in RC2  (Read 3724 times)

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 383
    • Alex's Link Sammlung
Problem with malloc.h in RC2
« on: May 25, 2009, 12:32:08 pm »
when I compile the following source, I get some errors in malloc.h

Code: [Select]
#include <windows.h>
#include <malloc.h>

int main()
{
return 0;
}

Errors:
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2001: Syntax error: expected ')' but found '('.
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2120: Redeclaration of 'size_t', previously declared at D:\Programme\ASw\Compiler\PellesC\Include\wchar.h(40); expected 'unsigned int' but found 'void'.
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2001: Syntax error: expected ';' but found ')'.
best regards
 Alex ;)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
Re: Problem with malloc.h in RC2
« Reply #1 on: May 25, 2009, 03:52:36 pm »
Yet another reason to use stdlib.h, then...  ;)

For now it should work if you change line 38 from:
Code: [Select]
#define _mm_malloc(n,m)  _mm_malloc((n),(m))
to: (remove the parenthesis around n and m)
Code: [Select]
#define _mm_malloc(n,m)  _mm_malloc(n,m)
/Pelle

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 383
    • Alex's Link Sammlung
Re: Problem with malloc.h in RC2
« Reply #2 on: May 25, 2009, 09:09:04 pm »
Yet another reason to use stdlib.h, then...  ;)

For now it should work if you change line 38 from:
Code: [Select]
#define _mm_malloc(n,m)  _mm_malloc((n),(m))
to: (remove the parenthesis around n and m)
Code: [Select]
#define _mm_malloc(n,m)  _mm_malloc(n,m)


Thanks Pelle!

I found it and I think to say (write) it would help to make Pelles C a little bit better (and it a great peace of software).  ;)
best regards
 Alex ;)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
Re: Problem with malloc.h in RC2
« Reply #3 on: May 26, 2009, 08:14:07 pm »
OK - thanks.
/Pelle

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 383
    • Alex's Link Sammlung
Re: Problem with malloc.h in RC2
« Reply #4 on: July 10, 2009, 10:12:37 pm »
when I compile the following source, I get some errors in malloc.h

Code: [Select]
#include <windows.h>
#include <malloc.h>

int main()
{
return 0;
}

Errors:
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2001: Syntax error: expected ')' but found '('.
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2120: Redeclaration of 'size_t', previously declared at D:\Programme\ASw\Compiler\PellesC\Include\wchar.h(40); expected 'unsigned int' but found 'void'.
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2001: Syntax error: expected ';' but found ')'.


This works with Pelles C RC3! :)

Thanks Pelle !!!
best regards
 Alex ;)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
Re: Problem with malloc.h in RC2
« Reply #5 on: July 11, 2009, 04:45:57 pm »
Good - thanks!
/Pelle