EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Motor record compilation error under win32-x86
From: Ron Sluiter <[email protected]>
To: Wang Xiaoqiang <[email protected]>
Cc: epics <[email protected]>
Date: Mon, 20 Apr 2009 11:19:28 -0500
Hello Xiaoqiang,

OK.  I will move the preprocessor assertions to the end of the logic
on the next release.

Thanks for your help,
Ron

Wang Xiaoqiang wrote:
Hi Ron,

Yes, that is not supported by MSVC. I try to compile a dummy file with
the following contents:

wang_x1@pc7149 /c/test
$ cat test.c
#if #cpu(i386)
    #error CPU i386 asserted
#endif

wang_x1@pc7149 /c/test
$ cl test.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762
for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

test.c
test.c(1) : error C2014: preprocessor command must start as first
nonwhite space
test.c(1) : fatal error C1017: invalid integer constant expression

Probably removing completely is not necessary. It does not harm if it is
put after checking _WIN32,
because MSVC will not contiue further. This was the case in motor 6-3
release.
#if defined(_WIN32) || defined (_M_IX86) || defined (_X86_)
#define LSB_First (TRUE) /* LSB is packed first. */ #elif #cpu(i386) #define LSB_First (TRUE) /* LSB is packed first. */ It seems MSVC
Best,
Xiaoqiang

-----Original Message-----
From: Ron Sluiter [mailto:[email protected]] Sent: Monday, April 20, 2009 4:22 PM
To: Wang Xiaoqiang
Cc: epics
Subject: Re: Motor record compilation error under win32-x86

Hello Wang,

I am guessing that it is the preprocessor assertions (e.g., #cpu(i386))
that are not supported by MSVC.

I suggest you test this by removing them from the file (motor.h) and
recompiling.  The preprocessor variables MSB_First and LSB_First may not
be correct, but at least we will know what exactly is not supported.

Ron

Wang Xiaoqiang wrote:
Hi,

When I compile motor 6-4-2 under win32-x86 with vs2008 (cl version 14.00.50727.762), it reports the following errors:

make[1]: Entering directory

`/c/epics/synApps_5_4/support/motor/6-4-2/motorApp/MotorSrc/O.win32-x86'
Installing generic include file ../../../include/motor.h
cl /nologo /EHsc /GR -c                /D_CRT_SECURE_NO_DEPRECATE
/D_CRT_NONSTDC_NO_DEPRECATE /D__STDC__=0   /Ox /GL   /W3 /w44355
/MT -DEPICS_DLL_NO   -I. -I..\\O.Common -I. -I..
-I..\\..\\..\\include\\os\\WIN32 -I..\\..\\..\\include -Ic:\\epics\\synApps_5_4\\support\\asyn\\4-10\\include
-Ic:\\epics\\synApps_5_4\\support\\seq\\2-0-12\\include
-Ic:\\epics\\base-3.14.10\\include\\os\\WIN32
-Ic:\\epics\\base-3.14.10\\include
-Ic:\\epics\\synApps_5_4\\support\\motor\\6-4-2\\include       /Tp
..\\motorRecord.cc
motorRecord.cc
c:\epics\synapps_5_4\support\motor\6-4-2\motorapp\motorsrc\motor.h(126
)
: error C2014: preprocessor command must start as first nonwhite space
c:\epics\synapps_5_4\support\motor\6-4-2\motorapp\motorsrc\motor.h(126
)
: fatal error C1017: invalid integer constant expression
make[1]: *** [motorRecord.obj] Error 2
make[1]: Leaving directory

`/c/epics/synApps_5_4/support/motor/6-4-2/motorApp/MotorSrc/O.win32-x86'
make: *** [install.win32-x86] Error 2

In motor.h(126): #if defined(_WIN32) || #cpu(i386) || defined (_M_IX86)
|| defined (_X86_),
the #cpu(i386) assertion confuses compiler. If I split it over two lines then it works.
#if defined(_WIN32) || defined (_M_IX86) || defined (_X86_)
#define LSB_First (TRUE) /* LSB is packed first. */ #elif #cpu(i386)
    #define LSB_First (TRUE)  /* LSB is packed first. */ It seems MSVC

does not accept directives mixed.

--
Dr. Xiaoqiang Wang
Paul Scherrer Institut, WBGB/010
5232 Villigen PSI, Switzerland





References:
Motor record compilation error under win32-x86 Wang Xiaoqiang
Re: Motor record compilation error under win32-x86 Ron Sluiter
RE: Motor record compilation error under win32-x86 Wang Xiaoqiang

Navigate by Date:
Prev: RE: Motor record compilation error under win32-x86 Wang Xiaoqiang
Next: 答复: Problems using the sscan record 张招红
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Motor record compilation error under win32-x86 Wang Xiaoqiang
Next: davis weather monitor II with Linux ioc Patrick Thomas
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·