Error in typedef

J

Joona I Palaste

(e-mail address removed) scribbled the following:
I'm getting a an error while compiling a file which includes "tcl.h"
(I'm using Borland C++):
tcl.h (393,39): , expected
Looking at the code shows:
typedef TCL_WIDE_INT_TYPE Tcl_WideINT;

What's wrong with this? Please give me some hints!

Assuming TCL_WIDE_INT_TYPE is a previously declared C type, and not a
macro, then the line above is absolutely OK and should not give any such
error. Are you sure it's not a macro? Does it say:
#define TCL_WIDE_INT_TYPE <something>
anywhere in tcl.h or any file it includes? (For any value of
<something>.)
What does it say on the lines immediately preceding this line? Maybe
you have a statement there that doesn't terminate in a ; or a }.
 
U

user

Hi,

I'm getting a an error while compiling a file which includes "tcl.h"
(I'm using Borland C++):

tcl.h (393,39): , expected

Looking at the code shows:

typedef TCL_WIDE_INT_TYPE Tcl_WideINT;


What's wrong with this? Please give me some hints!

Aleks
 
U

user

Joona said:
(e-mail address removed) scribbled the following:



Assuming TCL_WIDE_INT_TYPE is a previously declared C type, and not a
macro, then the line above is absolutely OK and should not give any such
error. Are you sure it's not a macro? Does it say:
#define TCL_WIDE_INT_TYPE <something>
anywhere in tcl.h or any file it includes? (For any value of
<something>.)
What does it say on the lines immediately preceding this line? Maybe
you have a statement there that doesn't terminate in a ; or a }.

Hi Joona,

thanks for the quick reply. You are right, it has to do with
TCL_WIDE_INT_TYPE not being defined.

Thanks again,

Aleks
 
M

Martin Ambuhl

Hi,

I'm getting a an error while compiling a file which includes "tcl.h"
(I'm using Borland C++):

tcl.h (393,39): , expected

Looking at the code shows:

typedef TCL_WIDE_INT_TYPE Tcl_WideINT;


What's wrong with this? Please give me some hints!

No one here can tell you. The first thing to do is to look to the lines
before (1) #include "tcl.h" and (2) the "offending" line in tcl.h. Your
compiler says that it couldn't handle the line at "tcl.h (393,39)." The
most common reason for this is lines before it. If "tcl.h" is a widely
used header, then the "lines before it" rate to be the lines before your
#include.
Be sure as well that TCL_WIDE_INT_TYPE has a legal definition visible at
that line.
 
A

Aleks

Hi,

thanks for your reply. Of course you are right. Below are the lines that
have to do with this erorr. It has something to do with
TCL_WIDE_INT_TYPE not being declared. But I would assume that it will be
defined by the if-construct (if it's not alreday set), right?

Aleks


....
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
# if defined(__CYGWIN__)
# define TCL_WIDE_INT_TYPE long long
# define TCL_LL_MODIFIER "L"
typedef struct stat Tcl_StatBuf;
# define TCL_LL_MODIFIER_SIZE 1
# elif defined(__WIN32__)
# define TCL_WIDE_INT_TYPE __int64
# ifdef __BORLANDC__
typedef struct stati64 Tcl_StatBuf;
# define TCL_LL_MODIFIER "L"
# define TCL_LL_MODIFIER_SIZE 1
# else /* __BORLANDC__ */
typedef struct _stati64 Tcl_StatBuf;
# define TCL_LL_MODIFIER "I64"
# define TCL_LL_MODIFIER_SIZE 3
# endif /* __BORLANDC__ */
# else /* __WIN32__ */
/*
* Don't know what platform it is and configure hasn't discovered what
* is going on for us. Try to guess...
*/
# ifdef NO_LIMITS_H
# error please define either TCL_WIDE_INT_TYPE or
TCL_WIDE_INT_IS_LONG
# else /* !NO_LIMITS_H */
# include <limits.h>
# if (INT_MAX < LONG_MAX)
# define TCL_WIDE_INT_IS_LONG 1
# else
# define TCL_WIDE_INT_TYPE long long
# endif
# endif /* NO_LIMITS_H */
# endif /* __WIN32__ */
#endif /* !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */
#ifdef TCL_WIDE_INT_IS_LONG
# undef TCL_WIDE_INT_TYPE
# define TCL_WIDE_INT_TYPE long
#endif /* TCL_WIDE_INT_IS_LONG */

typedef TCL_WIDE_INT_TYPE Tcl_WideInt; <-- Error ", expected"
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top