Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#161 rdesktop mak `e breaks

open
nobody
None
5
2012-11-29
2009-01-20
Anonymous
No

make on a Solaris 10 workstation cames back with:
make
gcc -g -O2 -Wall -I/usr/local/ssl/include -I/usr/openwin/include -DPACKAGE_NAME=\"rdesktop\" -DPACKAGE_TARNAME=\"rdesktop\" -DPACKAGE_VERSION=\"1.6.0\" -DPACKAGE_STRING=\"rdesktop\ 1.6.0\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DB_ENDIAN=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_FILIO_H=1 -DHAVE_LOCALE_H=1 -DHAVE_LANGINFO_H=1 -Dssldir=\"/usr/local/ssl\" -DNEED_ALIGN=1 -DEGD_SOCKET=\"/var/run/egd-pool\" -DWITH_RDPSND=1 -DRDPSND_SUN=1 -DHAVE_DIRENT_H=1 -DHAVE_DECL_DIRFD=0 -DDIR_FD_MEMBER_NAME=dd_fd -DHAVE_ICONV_H=1 -DHAVE_ICONV=1 -DICONV_CONST=const -DHAVE_SYS_VFS_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_MOUNT_H=1 -DSTAT_STATVFS64=1 -DHAVE_STRUCT_STATVFS_F_NAMEMAX=1 -D_FILE_OFFSET_BITS=64 -DKEYMAP_PATH=\"/usr/local/share/rdesktop/keymaps/\" -o xclip.o -c xclip.c
In file included from xclip.c:22:
/usr/openwin/include/X11/Xlib.h:38: warning: ignoring pragma: "@(#)Xlib.h 1.12 04/07/14 SMI
xclip.c: In function `utf16_lf2crlf':
xclip.c:173: parse error before `uvalue_previous'
xclip.c:179: `uvalue_previous' undeclared (first use in this function)
xclip.c:179: (Each undeclared identifier is reported only once
xclip.c:179: for each function it appears in.)
*** Error code 1
make: Fatal error: Command failed for target `xclip.o'

any ideas ?
mratzke@ford.com

Discussion

  • Aaron Watry
    Aaron Watry
    2009-04-28

    The problem is that the Sun compiler can't handle variable declarations mid-function. If you move the variable declarations for previous, uvalue, and uvalue_previous to the top of their respective functions, the program will then compile. If I can figure out how to attach a diff/patch to this tracker, I'll do so in a moment.

     
  • Aaron Watry
    Aaron Watry
    2009-04-28

    It seems that I can't find any easy way to upload the patch file without creating a new topic/bug report. Copying/pasting the patch below:

    --- xclip.c Wed Apr 25 08:44:26 2007
    +++ xclip.c.1 Tue Apr 28 15:41:21 2009
    @@ -156,7 +156,7 @@
    utf16_lf2crlf(uint8 * data, uint32 * size)
    {
    uint8 *result;
    - uint16 *inptr, *outptr;
    + uint16 *inptr, *outptr, uvalue_previous, uvalue;
    RD_BOOL swap_endianess;

    /\* Worst case: Every char is LF \*/
    

    @@ -170,10 +170,10 @@
    /* Check for a reversed BOM */
    swap_endianess = (*inptr == 0xfffe);

    - uint16 uvalue_previous = 0; /* Kept so we'll avoid translating CR-LF to CR-CR-LF */
    + uvalue_previous = 0; /* Kept so we'll avoid translating CR-LF to CR-CR-LF */
    while ((uint8 *) inptr < data + *size)
    {
    - uint16 uvalue = *inptr;
    + uvalue = *inptr;
    if (swap_endianess)
    uvalue = ((uvalue << 8) & 0xff00) + (uvalue >> 8);
    if ((uvalue == 0x0a) && (uvalue_previous != 0x0d))
    @@ -192,7 +192,7 @@
    static uint8 *
    lf2crlf(uint8 * data, uint32 * length)
    {
    - uint8 *result, *p, *o;
    + uint8 *result, *p, *o, previous;

    /\* Worst case: Every char is LF \*/
    result = xmalloc\(\*length \* 2\);
    

    @@ -200,7 +200,7 @@
    p = data;
    o = result;

    - uint8 previous = '\0'; /* Kept to avoid translating CR-LF to CR-CR-LF */
    + previous = '\0'; /* Kept to avoid translating CR-LF to CR-CR-LF */
    while (p < data + *length)
    {
    if ((*p == '\x0a') && (previous != '\x0d'))