Mostly #ifdefs and missing casts.
>From e9781d995dd7d659a6aa1624af79d6513c8ed4ad Mon Sep 17 00:00:00 2001
From: Pascal Stumpf <pascal.stu...@cubes.de>
Date: Fri, 10 Aug 2012 14:07:06 +0200
Subject: [PATCH] Tooltalk fixes for OpenBSD.  This consists mainly of
 #ifdefs, casts and some small type nits.

---
 cde/lib/tt/bin/shell/mover.C                       |    2 +-
 cde/lib/tt/bin/shell/remover.C                     |    2 +-
 cde/lib/tt/bin/tt_type_comp/frozen.mp_types_gram.C |    4 ++
 cde/lib/tt/bin/ttdbserverd/db_server_functions.C   |    3 +-
 cde/lib/tt/bin/tttar/tttar.C                       |    2 +-
 cde/lib/tt/bin/tttar/tttar_api.C                   |    4 +-
 cde/lib/tt/bin/tttar/tttar_spec.C                  |    2 +-
 cde/lib/tt/lib/api/c/api_api.C                     |    4 ++
 cde/lib/tt/lib/db/tt_db_property.C                 |    2 +-
 cde/lib/tt/lib/mp/mp_c_session.C                   |    4 +-
 cde/lib/tt/lib/mp/mp_desktop.C                     |    2 +-
 cde/lib/tt/lib/mp/mp_message.C                     |    2 +-
 cde/lib/tt/lib/tt_options.h                        |   30 ++++++++++++++++++++
 cde/lib/tt/lib/tttk/ttdesktop.C                    |   24 ++++++++--------
 cde/lib/tt/lib/tttk/ttdtfile.C                     |    6 ++--
 cde/lib/tt/lib/tttk/ttdtprocid.C                   |   12 ++++----
 cde/lib/tt/lib/tttk/ttmedia.C                      |    4 +-
 cde/lib/tt/lib/tttk/tttk.C                         |    2 +-
 cde/lib/tt/lib/tttk/tttkmessage.C                  |    2 +-
 cde/lib/tt/lib/tttk/tttkpattern.C                  |    2 +-
 cde/lib/tt/lib/util/tt_file_system.C               |   12 ++++++--
 cde/lib/tt/lib/util/tt_host.C                      |    2 +-
 cde/lib/tt/lib/util/tt_host_equiv.C                |    4 +-
 cde/lib/tt/lib/util/tt_iostream.C                  |    2 +-
 cde/lib/tt/lib/util/tt_iostream.h                  |    2 +-
 cde/lib/tt/lib/util/tt_log.C                       |    2 +-
 cde/lib/tt/lib/util/tt_path.C                      |    4 +-
 cde/lib/tt/lib/util/tt_string.C                    |    3 +-
 cde/lib/tt/lib/util/tt_string_map.C                |    4 +-
 cde/lib/tt/lib/util/tt_string_match.C              |    4 ++
 cde/lib/tt/lib/util/tt_tracefile_parse.C           |    3 +-
 cde/lib/tt/lib/util/tt_xdr_utils.C                 |   16 ++++++++++
 cde/lib/tt/mini_isam/isam_impl.h                   |    2 +-
 cde/lib/tt/mini_isam/iscntl.c                      |    6 ++--
 cde/lib/tt/slib/mp_otype.C                         |    2 +-
 cde/lib/tt/slib/mp_ptype.C                         |    2 +-
 cde/lib/tt/slib/mp_rpc_implement.C                 |    2 +-
 cde/lib/tt/slib/mp_signature.C                     |    2 +-
 cde/lib/tt/slib/mp_typedb.C                        |    2 +-
 39 files changed, 129 insertions(+), 62 deletions(-)

diff --git a/cde/lib/tt/bin/shell/mover.C b/cde/lib/tt/bin/shell/mover.C
index 264f50a..6a412c0 100644
--- a/cde/lib/tt/bin/shell/mover.C
+++ b/cde/lib/tt/bin/shell/mover.C
@@ -35,7 +35,7 @@
 #include "tt_options.h"
 #include <errno.h>
 #include <string.h>
-#if defined(__osf__) || defined(linux)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
 #include <unistd.h>
 #else
 #if !defined(USL) && !defined(__uxp__)
diff --git a/cde/lib/tt/bin/shell/remover.C b/cde/lib/tt/bin/shell/remover.C
index 3d3002d..f96b32c 100644
--- a/cde/lib/tt/bin/shell/remover.C
+++ b/cde/lib/tt/bin/shell/remover.C
@@ -35,7 +35,7 @@
 #include "tt_options.h"
 #include <errno.h>
 #include <string.h>
-#if defined(__osf__) || defined(linux)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
 #include <unistd.h>
 #else
 #if !defined(USL) && !defined(__uxp__)
diff --git a/cde/lib/tt/bin/tt_type_comp/frozen.mp_types_gram.C 
b/cde/lib/tt/bin/tt_type_comp/frozen.mp_types_gram.C
index 7a532ee..cbd4ec7 100644
--- a/cde/lib/tt/bin/tt_type_comp/frozen.mp_types_gram.C
+++ b/cde/lib/tt/bin/tt_type_comp/frozen.mp_types_gram.C
@@ -91,7 +91,11 @@ typedef union
  */
 #undef MAXINT
 #endif
+#if defined(CSRG_BASED)
+#define MAXINT INT_MAX
+#else
 #include <values.h>
+#endif
 
 #ifdef __cplusplus
 
diff --git a/cde/lib/tt/bin/ttdbserverd/db_server_functions.C 
b/cde/lib/tt/bin/ttdbserverd/db_server_functions.C
index e81863f..2264eb6 100644
--- a/cde/lib/tt/bin/ttdbserverd/db_server_functions.C
+++ b/cde/lib/tt/bin/ttdbserverd/db_server_functions.C
@@ -41,6 +41,7 @@
 #include <sys/stat.h>
 #include <sys/param.h>
 #include <errno.h>
+#include <stdint.h>
 #include <unistd.h>
 #include <nl_types.h>
 
@@ -2773,7 +2774,7 @@ _tt_run_garbage_collect(int in_parallel)
            }
        } else {
 #endif /* OPT_AUTO_GARBAGE_COLLECT*/
-           exit((int)_tt_garbage_collect(NULL));
+           exit((intptr_t)_tt_garbage_collect(NULL));
 #if defined(OPT_AUTO_GARBAG_COLLECT)
        }
 #endif /* OPT_AUTO_GARBAGE_COLLECT*/
diff --git a/cde/lib/tt/bin/tttar/tttar.C b/cde/lib/tt/bin/tttar/tttar.C
index c26432f..cf0875c 100644
--- a/cde/lib/tt/bin/tttar/tttar.C
+++ b/cde/lib/tt/bin/tttar/tttar.C
@@ -37,7 +37,7 @@
 #include <stdlib.h>
 #include <sys/param.h>
 #include <sys/stat.h>
-#if defined(__osf__) || defined(linux)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
 #include <unistd.h>
 #else
 #if !defined(USL) && !defined(__uxp__)
diff --git a/cde/lib/tt/bin/tttar/tttar_api.C b/cde/lib/tt/bin/tttar/tttar_api.C
index 7622dcb..29c002a 100644
--- a/cde/lib/tt/bin/tttar/tttar_api.C
+++ b/cde/lib/tt/bin/tttar/tttar_api.C
@@ -33,7 +33,7 @@
  */
 
 #include <errno.h>
-#if defined(__osf__) || defined(linux)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
 #include <unistd.h>
 #else
 #ifndef USL
@@ -230,7 +230,7 @@ pathlist_lstt_dearchive(
                                 (char *)our_process_name, (int)obj_kind );
                        return FALSE;
                }
-               if (verbosity && (    (last_path != this_path)
+               if (verbosity && (    (last_path != (const char *)this_path)
                                 || (obj_kind == ARCHIVE_END)))
                {
                        if (last_path_valid) {
diff --git a/cde/lib/tt/bin/tttar/tttar_spec.C 
b/cde/lib/tt/bin/tttar/tttar_spec.C
index 4c4df4a..659bf6f 100644
--- a/cde/lib/tt/bin/tttar/tttar_spec.C
+++ b/cde/lib/tt/bin/tttar/tttar_spec.C
@@ -32,7 +32,7 @@
  *
  */
 
-#if defined(__osf__) || defined(linux)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
 #include <unistd.h>
 #else
 #if defined (USL) || defined(__uxp__)
diff --git a/cde/lib/tt/lib/api/c/api_api.C b/cde/lib/tt/lib/api/c/api_api.C
index 9025677..91ef6d4 100644
--- a/cde/lib/tt/lib/api/c/api_api.C
+++ b/cde/lib/tt/lib/api/c/api_api.C
@@ -742,8 +742,12 @@ _tt_errno_status(
            case EPIPE:         return TT_DESKTOP_EPIPE;
            case ENOMSG:        return TT_DESKTOP_ENOMSG;
            case EDEADLK:       return TT_DESKTOP_EDEADLK;
+#ifdef ENODATA
            case ENODATA:       return TT_DESKTOP_ENODATA;
+#endif
+#ifdef EPROTO
            case EPROTO:        return TT_DESKTOP_EPROTO;
+#endif
 #if !defined(OPT_BUG_AIX)
 // on AIX, ENOTEMPTY is the same code as EEXIST, and the switch
 // statement fails to compile with duplicate case labels..
diff --git a/cde/lib/tt/lib/db/tt_db_property.C 
b/cde/lib/tt/lib/db/tt_db_property.C
index fb3ceca..9a08a46 100644
--- a/cde/lib/tt/lib/db/tt_db_property.C
+++ b/cde/lib/tt/lib/db/tt_db_property.C
@@ -59,7 +59,7 @@ is_empty() const
 
  // check the list for all NULL content member tt_strings
  _Tt_string_list_cursor values_cursor(values);
- while (values_cursor.next())  if (*values_cursor != (char*)NULL) return FALSE;
+ while (values_cursor.next())  if (*values_cursor != (const char*)NULL) return 
FALSE;
 
  return TRUE;
 } 
diff --git a/cde/lib/tt/lib/mp/mp_c_session.C b/cde/lib/tt/lib/mp/mp_c_session.C
index aefff74..78a3753 100644
--- a/cde/lib/tt/lib/mp/mp_c_session.C
+++ b/cde/lib/tt/lib/mp/mp_c_session.C
@@ -284,13 +284,13 @@ startup_ttsession(_Tt_string &start_ttcmd)
 
        istat = signal(SIGINT, SIG_IGN);
        qstat = signal(SIGQUIT, SIG_IGN);
-       cstat = signal(SIGCLD, SIG_DFL);
+       cstat = signal(SIGCHLD, SIG_DFL);
 
        w = waitpid(pid, &status, 0);
 
        (void) signal(SIGINT, istat);
        (void) signal(SIGQUIT, qstat);
-       (void) signal(SIGCLD, cstat);
+       (void) signal(SIGCHLD, cstat);
 
        return((w == -1)? w: status);
        
diff --git a/cde/lib/tt/lib/mp/mp_desktop.C b/cde/lib/tt/lib/mp/mp_desktop.C
index a550624..41198f8 100644
--- a/cde/lib/tt/lib/mp/mp_desktop.C
+++ b/cde/lib/tt/lib/mp/mp_desktop.C
@@ -47,7 +47,7 @@
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/time.h>
-#if defined(__STDC__) && !defined(linux)
+#if defined(__STDC__) && !defined(linux) && !defined(CSRG_BASED)
 extern "C" {  extern int ioctl         (int, int, ...) ; };
 #endif     
 #include "util/tt_global_env.h"
diff --git a/cde/lib/tt/lib/mp/mp_message.C b/cde/lib/tt/lib/mp/mp_message.C
index 34e5b4a..1c00fca 100644
--- a/cde/lib/tt/lib/mp/mp_message.C
+++ b/cde/lib/tt/lib/mp/mp_message.C
@@ -118,7 +118,7 @@ base_constructor()
 
 _Tt_message::
 _Tt_message()
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 : _pattern_id(), _object(), _file(), _op(),
   _otype(), _sender_ptype(), _handler_ptype(),
   _api_id(), _status_string()
diff --git a/cde/lib/tt/lib/tt_options.h b/cde/lib/tt/lib/tt_options.h
index 52b9d1e..e6f8c39 100644
--- a/cde/lib/tt/lib/tt_options.h
+++ b/cde/lib/tt/lib/tt_options.h
@@ -560,6 +560,36 @@
 # define OPT_BUG_RPCINTR
 # undef  OPT_XTHREADS 
 
+#elif defined(__OpenBSD__)
+
+# undef  OPT_UNIX_SOCKET_RPC 
+# undef  OPT_TLI 
+# undef  OPT_DLOPEN_X11 
+# undef  OPT_DLOPEN_CE 
+# undef  OPT_ADDMSG_DIRECT 
+# undef  OPT_SECURE_RPC 
+# undef  OPT_CLASSING_ENGINE
+# undef  OPT_PATCH
+# define OPT_POSIX_SIGNAL
+# undef  OPT_BSD_WAIT
+# undef  OPT_DGETTEXT
+# define OPT_CATGETS
+# undef  OPT_GETDTABLESIZE
+# undef  OPT_SYSINFO
+# define OPT_CPP_PATH          "/usr/libexec/cpp"
+# define OPT_CPP_OPTIONS       ""
+# define OPT_STRERROR
+# undef  OPT_SVR4_GETMNTENT
+# undef  OPT_LOCKF_MNTENT
+# define OPT_LOCAL_MOUNT_TYPE  MNTTYPE_UFS
+# undef  OPT_OLD_RPC
+# define OPT_DEFINE_SIG_PF
+# define OPT_TAR_HAS_EXCLUDE_OPTION
+# define OPT_HAS_REALPATH
+# define OPT_AUTOMOUNT_PATH_FIX
+# define OPT_BUG_RPCINTR
+# undef  OPT_XTHREADS 
+
 #else
 /* Unknown configuration, complain */
 }}}} You must edit lib/tt_options.h and add a section defining the options for 
your configuration.
diff --git a/cde/lib/tt/lib/tttk/ttdesktop.C b/cde/lib/tt/lib/tttk/ttdesktop.C
index 61130d2..3650d4c 100644
--- a/cde/lib/tt/lib/tttk/ttdesktop.C
+++ b/cde/lib/tt/lib/tttk/ttdesktop.C
@@ -679,7 +679,7 @@ _ttdt_GSet_Geometry(
 {
        Tt_message msg = _ttDesktopMessageCreate( commission, theClass,
                                handler, op, _ttdt_Geometry_in_cb,
-                               callback, clientdata );
+                               (void *)callback, clientdata );
        Tt_status status = tt_ptr_error( msg );
        if (status != TT_OK) {
                return msg;
@@ -814,7 +814,7 @@ ttdt_Set_Geometry_pat(
 {
        return _ttdt_pat( TTDT_SET_GEOMETRY, _ttdt_Geometry_out_cb,
                          category, commission,
-                         callback, clientdata, register_it );
+                         (void *)callback, clientdata, register_it );
 }
 
 Tt_pattern
@@ -828,7 +828,7 @@ ttdt_Get_Geometry_pat(
 {
        return _ttdt_pat( TTDT_GET_GEOMETRY, _ttdt_Geometry_out_cb,
                          category, commission,
-                         callback, clientdata, register_it );
+                         (void *)callback, clientdata, register_it );
 }
 
 static int
@@ -953,7 +953,7 @@ _ttdt_GSet_Iconified(
 {
        Tt_message msg = _ttDesktopMessageCreate( commission, theClass,
                                handler, op, _ttdt_Iconified_in_cb,
-                               callback, clientdata );
+                               (void *)callback, clientdata );
        Tt_status status = tt_ptr_error( msg );
        if (status != TT_OK) {
                return msg;
@@ -1048,7 +1048,7 @@ ttdt_Set_Iconified_pat(
 
        return _ttdt_pat( TTDT_SET_ICONIFIED, _ttdt_Iconified_out_cb,
                          category, commission,
-                         callback, clientdata, register_it );
+                         (void *)callback, clientdata, register_it );
 }
 
 Tt_pattern
@@ -1062,7 +1062,7 @@ ttdt_Get_Iconified_pat(
 {
        return _ttdt_pat( TTDT_GET_ICONIFIED, _ttdt_Iconified_out_cb,
                          category, commission,
-                         callback, clientdata, register_it );
+                         (void *)callback, clientdata, register_it );
 }
 
 //
@@ -1226,7 +1226,7 @@ _ttdt_GSet_XInfo(
 {
        Tt_message msg = _ttDesktopMessageCreate( commission, theClass,
                                handler, op, _ttdt_XInfo_in_cb,
-                               callback, clientdata );
+                               (void *)callback, clientdata );
        Tt_status status = tt_ptr_error( msg );
        if (status != TT_OK) {
                return msg;
@@ -1345,7 +1345,7 @@ ttdt_Set_XInfo_pat(
 {
        return _ttdt_pat( TTDT_SET_XINFO, _ttdt_XInfo_out_cb,
                          category, commission,
-                         callback, clientdata, register_it );
+                         (void *)callback, clientdata, register_it );
 }
 
 Tt_pattern
@@ -1359,7 +1359,7 @@ ttdt_Get_XInfo_pat(
 {
        return _ttdt_pat( TTDT_GET_XINFO, _ttdt_XInfo_out_cb,
                          category, commission,
-                         callback, clientdata, register_it );
+                         (void *)callback, clientdata, register_it );
 }
 
 //
@@ -1501,7 +1501,7 @@ ttdt_Get_Locale(
        }
        Tt_message msg = _ttDtPMessageCreate( commission, TT_REQUEST,
                                TT_SESSION, handler,
-                               TTDT_GET_LOCALE, _ttDtGetLocaleCB, clientCB,
+                               TTDT_GET_LOCALE, _ttDtGetLocaleCB, (void 
*)clientCB,
                                clientData );
        Tt_status status = tt_ptr_error( msg );
        if (status != TT_OK) {
@@ -1614,7 +1614,7 @@ ttdt_Get_Situation(
        Tt_message msg = _ttDtPMessageCreate( commission, TT_REQUEST,
                                TT_SESSION, _handler,
                                TTDT_GET_SITUATION, _ttDtGetSituationCB,
-                               clientCB, clientData );
+                               (void *)clientCB, clientData );
        Tt_status status = tt_ptr_error( msg );
        if (status != TT_OK) {
                return msg;
@@ -1661,7 +1661,7 @@ _ttdt_posix_cb(
                struct utsname  names;
                char            buf[ SYS_NMLN ];
            case TTDT_SET_LOCALE:
-               return _ttDtGetLocaleCB( msg, pat, _ttDtApplyLocale, 0 );
+               return _ttDtGetLocaleCB( msg, pat, (void *)_ttDtApplyLocale, 0 
);
            case TTDT_GET_LOCALE:
                for (i = 0; i < numArgs/2; i++) {
                        categoryName = _tttk_message_arg_val( msg, 2 * i, 0 );
diff --git a/cde/lib/tt/lib/tttk/ttdtfile.C b/cde/lib/tt/lib/tttk/ttdtfile.C
index ea1b5fb..4d5f299 100644
--- a/cde/lib/tt/lib/tttk/ttdtfile.C
+++ b/cde/lib/tt/lib/tttk/ttdtfile.C
@@ -115,7 +115,7 @@ _ttDtFileJoinPat(
        Tt_pattern pat = _ttDtPatternCreate( TT_OBSERVE, theScope,
                                             theScope != TT_FILE, pathname,
                                             TTDT_DELETED, _ttDtFileCB,
-                                            cb, clientData, 0 );
+                                            (void *)cb, clientData, 0 );
        Tt_status status = tt_ptr_error( pat );
        if (status != TT_OK) {
                return pat;
@@ -254,7 +254,7 @@ ttdt_file_request(
 )
 {
        Tt_message msg = _ttDtPMessageCreate( context, TT_REQUEST, theScope, 0,
-                                             op, _ttDtFileCB, cb, clientData);
+                                             op, _ttDtFileCB, (void *)cb, 
clientData);
        Tt_status status = tt_ptr_error( msg );
        if (status != TT_OK) {
                return msg;
@@ -298,7 +298,7 @@ _ttDtFileEventPat(
        Tt_pattern pat = _ttDtPatternCreate( TT_HANDLE, theScope,
                                             theScope != TT_FILE, pathname,
                                             TTDT_SAVE, _ttDtFileCB,
-                                            cb, clientData, 0 );
+                                            (void *)cb, clientData, 0 );
        Tt_status status = tt_ptr_error( pat );
        if (status != TT_OK) {
                return pat;
diff --git a/cde/lib/tt/lib/tttk/ttdtprocid.C b/cde/lib/tt/lib/tttk/ttdtprocid.C
index a9644bb..c47945e 100644
--- a/cde/lib/tt/lib/tttk/ttdtprocid.C
+++ b/cde/lib/tt/lib/tttk/ttdtprocid.C
@@ -102,7 +102,7 @@ pats_create(
                pats[++i] = ttdt_Set_XInfo_pat( TT_HANDLE, contract,
                                _ttdt_do_Set_XInfo, shell, 1 );
                pats[++i] = _ttdt_pat(TTDT_RAISE, _ttdt_contract_cb, TT_HANDLE,
-                               contract, _ttdt_do_RaiseLower, shell, 0 );
+                               contract, (void *)_ttdt_do_RaiseLower, shell, 0 
);
                tt_pattern_op_add( pats[i], _ttDtOp( TTDT_LOWER ) );
                tt_pattern_session_add( pats[i], sess );
                tt_pattern_register( pats[i] );
@@ -126,7 +126,7 @@ pats_create(
                pats[++i] = ttdt_Set_XInfo_pat( TT_HANDLE, contract,
                                (Ttdt_XInfo_in_cb)cb, clientData, 1 );
                pats[++i] = _ttdt_pat(TTDT_RAISE, _ttdt_contract_cb, TT_HANDLE,
-                               contract, cb, clientData, 0 );
+                               contract, (void *)cb, clientData, 0 );
                tt_pattern_op_add( pats[i], _ttDtOp( TTDT_LOWER ) );
                tt_pattern_session_add( pats[i], sess );
                tt_pattern_register( pats[i] );
@@ -145,17 +145,17 @@ pats_create(
                }
        }
        pats[++i] = _ttdt_pat(  TTDT_QUIT, _ttdt_contract_cb, TT_HANDLE,
-                               contract, cb, _clientData, 1 );
+                               contract, (void *)cb, _clientData, 1 );
        pats[++i] = _ttdt_pat(  TTDT_PAUSE, _ttdt_contract_cb, TT_HANDLE,
-                               contract, cb, (cb ? clientData : shell), 0 );
+                               contract, (void *)cb, (cb ? clientData : 
shell), 0 );
        tt_pattern_op_add( pats[i], _ttDtOp( TTDT_RESUME ));
        tt_pattern_session_add( pats[i], sess );
        tt_pattern_register( pats[i] );
        pats[++i] = _ttdt_pat(  TTDT_GET_STATUS, _ttdt_contract_cb, TT_HANDLE,
-                               contract, cb, clientData, 1 );
+                               contract, (void *)cb, clientData, 1 );
        if (contract == 0) {
                pats[++i]= _ttdt_pat( TTDT_DO_COMMAND, _ttdt_contract_cb,
-                                     TT_HANDLE, contract, cb, clientData, 1 );
+                                     TT_HANDLE, contract, (void *)cb, 
clientData, 1 );
                pats[++i]= _ttdt_pat( TTDT_SET_LOCALE, _ttdt_posix_cb,
                                      TT_HANDLE, contract, 0, 0, 0 );
                tt_pattern_op_add( pats[i], _ttDtOp( TTDT_GET_LOCALE ));
diff --git a/cde/lib/tt/lib/tttk/ttmedia.C b/cde/lib/tt/lib/tttk/ttmedia.C
index 6792f67..094c782 100644
--- a/cde/lib/tt/lib/tttk/ttmedia.C
+++ b/cde/lib/tt/lib/tttk/ttmedia.C
@@ -381,7 +381,7 @@ ttmedia_Deposit_pat(
 {
        Tt_pattern pat = _ttDtPatternCreate( category, TT_SESSION,
                                             register_it, 0, TTME_DEPOSIT,
-                                            _ttMediaLoadMsgCB, clientcb,
+                                            _ttMediaLoadMsgCB, (void 
*)clientcb,
                                             clientdata, 0 );
        Tt_status status = tt_ptr_error( pat );
        if (status != TT_OK) {
@@ -418,7 +418,7 @@ ttmedia_load(
 )
 {
        Tt_message msg = _ttDtPMessageCreate( context, TT_REQUEST, TT_SESSION,
-                               0, op, _ttMediaLoadMsgCB, cb, clientData );
+                               0, op, _ttMediaLoadMsgCB, (void *)cb, 
clientData );
        Tt_status status = tt_ptr_error( msg );
        if (status != TT_OK) {
                return msg;
diff --git a/cde/lib/tt/lib/tttk/tttk.C b/cde/lib/tt/lib/tttk/tttk.C
index 734adbd..1f0c2b8 100644
--- a/cde/lib/tt/lib/tttk/tttk.C
+++ b/cde/lib/tt/lib/tttk/tttk.C
@@ -365,7 +365,7 @@ ttdt_subcontract_manage(
                                (Ttdt_XInfo_out_cb)cb, clientData, 1 );
        }
        pats[2] = _ttdt_pat(    TTDT_STATUS, _ttdt_contract_cb, TT_OBSERVE,
-                               subcontract, cb, clientData, 1 );
+                               subcontract, (void *)cb, clientData, 1 );
        pats[ numPats - 1 ] = 0;
        for (int i = 0; i < numPats; i++) {
                Tt_status status = tt_ptr_error( pats[ i ] );
diff --git a/cde/lib/tt/lib/tttk/tttkmessage.C 
b/cde/lib/tt/lib/tttk/tttkmessage.C
index c20606c..efe87e0 100644
--- a/cde/lib/tt/lib/tttk/tttkmessage.C
+++ b/cde/lib/tt/lib/tttk/tttkmessage.C
@@ -169,7 +169,7 @@ _ttDtPMessageCreate(
                return msg;
        }
        _TttkItem2Free fuse( msg );
-       status = tt_message_user_set( msg, _TttkCBKey, cb );
+       status = tt_message_user_set( msg, _TttkCBKey, (void *)cb );
        if (status != TT_OK) {
                return (Tt_message)tt_error_pointer( status );
        }
diff --git a/cde/lib/tt/lib/tttk/tttkpattern.C 
b/cde/lib/tt/lib/tttk/tttkpattern.C
index 8d88bf1..d59accd 100644
--- a/cde/lib/tt/lib/tttk/tttkpattern.C
+++ b/cde/lib/tt/lib/tttk/tttkpattern.C
@@ -161,7 +161,7 @@ _ttDtPatternCreate(
        if (status != TT_OK) {
                return (Tt_pattern)tt_error_pointer( status );
        }
-       status = tt_pattern_user_set( pat, _TttkCBKey, cb );
+       status = tt_pattern_user_set( pat, _TttkCBKey, (void *)cb );
        if (status != TT_OK) {
                return (Tt_pattern)tt_error_pointer( status );
        }
diff --git a/cde/lib/tt/lib/util/tt_file_system.C 
b/cde/lib/tt/lib/util/tt_file_system.C
index ef96dc3..074d2a5 100644
--- a/cde/lib/tt/lib/util/tt_file_system.C
+++ b/cde/lib/tt/lib/util/tt_file_system.C
@@ -82,13 +82,16 @@
 #      define ttFsName(e) vmt2dataptr(e,VMT_OBJECT)
 #      define ttMountPt(e) vmt2dataptr(e,VMT_STUB)
 #      define ttCloseMntTbl(f)         free(tmpbuf)    
-#elif defined(__osf__)
+#elif defined(__osf__) || defined(CSRG_BASED)
 #       include <sys/types.h>
 #       include <sys/mount.h>
+# ifdef __osf__
         extern "C" int getfsstat(struct statfs *, long, int);
+# endif
 #       define MNTTYPE_NFS              "nfs"
 #       define ttOpenMntTbl(path,mode)  ((FILE *) 1)
 #       define TtMntEntry               struct statfs *
+# ifdef __osf__
 #       define ttFsType(e)              \
                                 (((e)->f_type == MOUNT_UFS) ? "ufs" \
                                 : (((e)->f_type == MOUNT_NFS3) ? "nfs" \
@@ -96,6 +99,9 @@
                                  : (((e)->f_type == MOUNT_CDFS) ? "cdfs" \
                                   : (((e)->f_type == MOUNT_PROCFS) ? "procfs" \
                                    : "unknown")))))
+# elif defined(CSRG_BASED)
+#      define ttFsType(e)              (e->f_fstypename)
+# endif
 #       define ttFsName(e)              ((char *)((e)->f_mntfromname))
 #       define ttMountPt(e)             ((char *)((e)->f_mntonname))
 #       define ttCloseMntTbl(f)         free(buf)
@@ -460,7 +466,7 @@ updateFileSystemEntries ()
 
        for (entry = (TtMntEntry)tmpbuf; rc > 0; --rc,
             entry = (TtMntEntry)((char *) entry + entry->vmt_length))
-#elif defined(__osf__)
+#elif defined(__osf__) || defined(CSRG_BASED)
         int             numfs,i;
         struct statfs   *buf;
         long            bufsize;
@@ -496,7 +502,7 @@ updateFileSystemEntries ()
 #else              
        while (entry = getmntent(mount_table))
 #endif
-#ifndef __osf__
+#if !defined(__osf__) && !defined(CSRG_BASED)
        {
 #endif
                fse =  createFileSystemEntry( entry );
diff --git a/cde/lib/tt/lib/util/tt_host.C b/cde/lib/tt/lib/util/tt_host.C
index 4c3aed3..5590c8f 100644
--- a/cde/lib/tt/lib/util/tt_host.C
+++ b/cde/lib/tt/lib/util/tt_host.C
@@ -48,7 +48,7 @@ extern "C" in_addr_t inet_addr(const char *);
 #ifdef __osf__
 #include <unistd.h>
 #else
-#if !defined(USL) && !defined(__uxp__) && !defined(linux)
+#if !defined(USL) && !defined(__uxp__) && !defined(linux) && 
!defined(CSRG_BASED)
 #include <osfcn.h>
 #endif
 #endif /* __osf */
diff --git a/cde/lib/tt/lib/util/tt_host_equiv.C 
b/cde/lib/tt/lib/util/tt_host_equiv.C
index fba3bdc..dec527b 100644
--- a/cde/lib/tt/lib/util/tt_host_equiv.C
+++ b/cde/lib/tt/lib/util/tt_host_equiv.C
@@ -36,12 +36,12 @@
 
 #define X_INCLUDE_NETDB_H
 #define XOS_USE_XT_LOCKING
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 #define index
 #define rindex
 #endif
 #include <X11/Xos_r.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 #undef index
 #undef rindex
 #endif
diff --git a/cde/lib/tt/lib/util/tt_iostream.C 
b/cde/lib/tt/lib/util/tt_iostream.C
index 1a9e3db..be69315 100644
--- a/cde/lib/tt/lib/util/tt_iostream.C
+++ b/cde/lib/tt/lib/util/tt_iostream.C
@@ -225,7 +225,7 @@ _Tt_ostream::operator <<(
        return *this;
 }
 
-#if defined(__osf__) || defined(linux)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
 /* This operator is being added to take care of uid_t and gid_t
  * for osf */
 const _Tt_ostream &
diff --git a/cde/lib/tt/lib/util/tt_iostream.h 
b/cde/lib/tt/lib/util/tt_iostream.h
index 326f37d..a814445 100644
--- a/cde/lib/tt/lib/util/tt_iostream.h
+++ b/cde/lib/tt/lib/util/tt_iostream.h
@@ -86,7 +86,7 @@ class _Tt_ostream : public virtual _Tt_allocated {
        const _Tt_ostream      &operator <<(
                                        int               n
                                ) const;
-#if defined(__osf__) || defined(linux)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
        const _Tt_ostream      &operator <<(
                                        unsigned int      n
                                ) const;
diff --git a/cde/lib/tt/lib/util/tt_log.C b/cde/lib/tt/lib/util/tt_log.C
index 340efe1..48955ad 100644
--- a/cde/lib/tt/lib/util/tt_log.C
+++ b/cde/lib/tt/lib/util/tt_log.C
@@ -37,7 +37,7 @@
 #ifdef __osf__
 #include <unistd.h>
 #else
-#if !defined (USL) && !defined(__uxp__) && !defined(linux)
+#if !defined (USL) && !defined(__uxp__) && !defined(linux) && 
!defined(CSRG_BASED)
 #include <osfcn.h>
 #endif
 #endif /* __osf__ */
diff --git a/cde/lib/tt/lib/util/tt_path.C b/cde/lib/tt/lib/util/tt_path.C
index 8dd9f2b..e51fd2d 100644
--- a/cde/lib/tt/lib/util/tt_path.C
+++ b/cde/lib/tt/lib/util/tt_path.C
@@ -49,12 +49,12 @@
 /* Included after "util/tt_string.h" to avoid index/strchr conflicts. */
 #define X_INCLUDE_DIRENT_H
 #define XOS_USE_NO_LOCKING
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 #define index
 #define rindex
 #endif
 #include <X11/Xos_r.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 #undef index
 #undef rindex
 #endif
diff --git a/cde/lib/tt/lib/util/tt_string.C b/cde/lib/tt/lib/util/tt_string.C
index 4b198bc..02855d3 100644
--- a/cde/lib/tt/lib/util/tt_string.C
+++ b/cde/lib/tt/lib/util/tt_string.C
@@ -54,7 +54,7 @@
 #endif
 #include <stdlib.h>
 #include <ctype.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 #include <wctype.h>
 #endif
 #include "util/tt_string.h"
@@ -1065,6 +1065,7 @@ _tt_xdr_decode(xdrproc_t xdr_fn, void *data, _Tt_string 
opaque_string)
 /* 
  * XDR encode or decode a _Tt_string
  */
+int
 tt_xdr_string(XDR *xdrs, _Tt_string *s)
 {
        return(s->xdr(xdrs));
diff --git a/cde/lib/tt/lib/util/tt_string_map.C 
b/cde/lib/tt/lib/util/tt_string_map.C
index 0c219c7..8d4c3c1 100644
--- a/cde/lib/tt/lib/util/tt_string_map.C
+++ b/cde/lib/tt/lib/util/tt_string_map.C
@@ -45,12 +45,12 @@
 /* Included after "util/tt_string.h" to avoid index/strchr conflicts. */
 #define X_INCLUDE_STRING_H
 #define XOS_USE_NO_LOCKING
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 #define index
 #define rindex
 #endif
 #include <X11/Xos_r.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 #undef index
 #undef rindex
 #endif
diff --git a/cde/lib/tt/lib/util/tt_string_match.C 
b/cde/lib/tt/lib/util/tt_string_match.C
index ff53f68..296708b 100644
--- a/cde/lib/tt/lib/util/tt_string_match.C
+++ b/cde/lib/tt/lib/util/tt_string_match.C
@@ -48,7 +48,11 @@
  */
 #undef MAXINT
 #endif
+#if defined(CSRG_BASED)
+#define MAXINT INT_MAX
+#else
 #include <values.h>     
+#endif
 
 static int     _tt_csh_match(const char *, const char *);
 static int     _tt_csh_match_star(const char *, const char *);
diff --git a/cde/lib/tt/lib/util/tt_tracefile_parse.C 
b/cde/lib/tt/lib/util/tt_tracefile_parse.C
index bfbf7b9..a5069ae 100644
--- a/cde/lib/tt/lib/util/tt_tracefile_parse.C
+++ b/cde/lib/tt/lib/util/tt_tracefile_parse.C
@@ -41,7 +41,8 @@
 #include "util/tt_trace_parser.h"
 #include "util/tt_entry_pt_names.h"
 
-#if defined (_AIX) || defined(hpux) || defined(__osf__) || defined(linux)
+#if defined (_AIX) || defined(hpux) || defined(__osf__) || defined(linux) || \
+       defined(CSRG_BASED)
 #include <fcntl.h>
 #endif
 
diff --git a/cde/lib/tt/lib/util/tt_xdr_utils.C 
b/cde/lib/tt/lib/util/tt_xdr_utils.C
index 2a8432a..ea814f6 100644
--- a/cde/lib/tt/lib/util/tt_xdr_utils.C
+++ b/cde/lib/tt/lib/util/tt_xdr_utils.C
@@ -40,6 +40,10 @@
 #include <memory.h>
 #include "tt_options.h"
 
+#if defined(CSRG_BASED)
+#define XDR __rpc_xdr
+#endif
+
 typedef bool_t (*local_xdrproc_t)(XDR *, caddr_t *);
 
 #ifndef OPT_XDR_LONG_TYPE
@@ -58,7 +62,11 @@ static bool_t
  * The third agrument is also wrong. Both SUN and DEC system header files
  * expect int instead of u_int.
  */
+#if defined(CSRG_BASED)
+tt_x_putbytes(XDR *xp, caddr_t, unsigned int len)
+#else
 tt_x_putbytes(XDR *xp, caddr_t, int len)
+#endif
 {
     xp->x_handy += RNDUP (len);
     return TRUE;
@@ -66,10 +74,16 @@ tt_x_putbytes(XDR *xp, caddr_t, int len)
 
 #if defined(ultrix) || defined(__osf__)
 static int*
+#elif defined(CSRG_BASED)
+static int32_t*
 #else
 static long *
 #endif
+#if defined(CSRG_BASED)
+tt_x_inline(XDR *xp, unsigned int len)
+#else
 tt_x_inline(XDR *xp, int len)
+#endif
 {
        /* Be paranoid -- some code really expects inline to
         * always succeed, so we keep a small buffer around
@@ -83,6 +97,8 @@ tt_x_inline(XDR *xp, int len)
        xp->x_handy += RNDUP (len);
 #if defined(ultrix) || defined(__osf__)
        return (int *) xp->x_private;
+#elif defined(CSRG_BASED)
+       return (int32_t *) xp->x_private;
 #else
        return (long *) xp->x_private;
 #endif
diff --git a/cde/lib/tt/mini_isam/isam_impl.h b/cde/lib/tt/mini_isam/isam_impl.h
index 92aea24..2e851c0 100644
--- a/cde/lib/tt/mini_isam/isam_impl.h
+++ b/cde/lib/tt/mini_isam/isam_impl.h
@@ -474,7 +474,7 @@ extern int _isfcb_cntlpg_w();
 #define VL_RECNOTAIL   ((long ) -2L)
 
 
-extern long lseek();
+/* extern long lseek(); */
 
 extern char *_ismalloc(), *_isrealloc(), *_isallocstring();
 extern void _isfree(), _isfreestring();
diff --git a/cde/lib/tt/mini_isam/iscntl.c b/cde/lib/tt/mini_isam/iscntl.c
index 80a9e23..1e28ddf 100644
--- a/cde/lib/tt/mini_isam/iscntl.c
+++ b/cde/lib/tt/mini_isam/iscntl.c
@@ -39,7 +39,7 @@ static char sccsid[] = "@(#)iscntl.c  1.8 94/11/17";
  *     Generic control function
  */
 
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 #include <stdarg.h>
 #else
 #include <varargs.h>
@@ -79,7 +79,7 @@ static char sccsid[] = "@(#)iscntl.c  1.8 94/11/17";
 
 typedef int (* intfunc)();
 
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 int 
 iscntl(int isfd, int func, ...)
 #else
@@ -94,7 +94,7 @@ iscntl(isfd, func, va_alist)
     va_list            pvar;
     int                        ret;
 
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
     va_start(pvar, func);
 #else
     va_start(pvar);
diff --git a/cde/lib/tt/slib/mp_otype.C b/cde/lib/tt/slib/mp_otype.C
index cde56ab..48a78e0 100644
--- a/cde/lib/tt/slib/mp_otype.C
+++ b/cde/lib/tt/slib/mp_otype.C
@@ -31,7 +31,7 @@
  * Copyright (c) 1990 by Sun Microsystems, Inc.
  */
 #include <stdlib.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 /*# include <g++/minmax.h>*/
 #else
 # include <macros.h>
diff --git a/cde/lib/tt/slib/mp_ptype.C b/cde/lib/tt/slib/mp_ptype.C
index 6878733..76ce3a8 100644
--- a/cde/lib/tt/slib/mp_ptype.C
+++ b/cde/lib/tt/slib/mp_ptype.C
@@ -26,7 +26,7 @@
 //%%  (c) Copyright 1993, 1994 Novell, Inc.                            
 //%%  $TOG: mp_ptype.C /main/4 1998/03/20 14:27:56 mgreess $                   
                                
 #include <stdlib.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 /*# include <g++/minmax.h>*/
 #else
 # include <macros.h>
diff --git a/cde/lib/tt/slib/mp_rpc_implement.C 
b/cde/lib/tt/slib/mp_rpc_implement.C
index 22c2238..68e9819 100644
--- a/cde/lib/tt/slib/mp_rpc_implement.C
+++ b/cde/lib/tt/slib/mp_rpc_implement.C
@@ -49,7 +49,7 @@
 #include <sys/uio.h>
 #include <fcntl.h>
 #include <unistd.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 /*# include <g++/minmax.h>*/
 #else
 # include <macros.h>
diff --git a/cde/lib/tt/slib/mp_signature.C b/cde/lib/tt/slib/mp_signature.C
index 259317b..6232357 100644
--- a/cde/lib/tt/slib/mp_signature.C
+++ b/cde/lib/tt/slib/mp_signature.C
@@ -35,7 +35,7 @@
  *  a procedure.
  */
 #include <stdlib.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 /*# include <g++/minmax.h>*/
 #else
 # include <macros.h>
diff --git a/cde/lib/tt/slib/mp_typedb.C b/cde/lib/tt/slib/mp_typedb.C
index 5ff381e..ca14065 100644
--- a/cde/lib/tt/slib/mp_typedb.C
+++ b/cde/lib/tt/slib/mp_typedb.C
@@ -39,7 +39,7 @@
 // databases. 
 //
 #include <stdlib.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 /*# include <g++/minmax.h>*/
 #else
 # include <macros.h>
-- 
1.7.6

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to