NO

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

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • 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: 2266
    • 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: 394
    • 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: 2266
    • 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: 394
    • 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: 2266
    • http://www.smorgasbordet.com
Re: Problem with malloc.h in RC2
« Reply #5 on: July 11, 2009, 04:45:57 PM »
Good - thanks!
/Pelle