See patch.
>From e1739161c2bc99c37ccce4b74d1ef42f45279e77 Mon Sep 17 00:00:00 2001
From: Pascal Stumpf <pascal.stu...@cubes.de>
Date: Sat, 11 Aug 2012 13:43:57 +0200
Subject: [PATCH] Make dtinfo work on OpenBSD.
strstream.h is now called "strstream" and is obsolete, but use it anyway until
all code is converted over. This also needs std:: added, at least for GCC
4.2.1. Lastly, when hardcoding the path to perl, /usr/bin/perl should be used
rather than anything else.
---
cde/programs/dtinfo/tools/misc/msgsets.C | 23 ++++++++++++-----------
cde/programs/dtinfo/tools/misc/treeres | 2 +-
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/cde/programs/dtinfo/tools/misc/msgsets.C
b/cde/programs/dtinfo/tools/misc/msgsets.C
index 48f0d24..6b59abf 100644
--- a/cde/programs/dtinfo/tools/misc/msgsets.C
+++ b/cde/programs/dtinfo/tools/misc/msgsets.C
@@ -42,7 +42,7 @@
#ifdef __cplusplus
#include <stdlib.h>
-#if !defined(__DECCXX) && !defined(USL)
+#if !defined(__DECCXX) && !defined(USL) && !defined(CSRG_BASED)
#include <osfcn.h>
#else
#include <unistd.h>
@@ -195,11 +195,12 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
/* All Rights Reserved */
#include <string.h>
-#include <strstream.h>
+#include <strstream>
+#include <iostream>
#define BUFFER_INCR_UNIT 64
-ostrstream **sets;
+std::ostrstream **sets;
int sets_cnt = 0; /* number of sets slots occupied */
int sets_max = 0; /* total number of sets slots */
@@ -509,14 +510,14 @@ case 1:
sets_max += BUFFER_INCR_UNIT;
if (sets_cnt == 0) {
- sets = (ostrstream **)
- malloc(sizeof(ostrstream *) * sets_max);
+ sets = (std::ostrstream **)
+ malloc(sizeof(std::ostrstream *) * sets_max);
set_nums = (int *)
malloc(sizeof(int) * sets_max);
}
else {
- sets = (ostrstream **)
- realloc(sets, sizeof(ostrstream *) * sets_max);
+ sets = (std::ostrstream **)
+ realloc(sets, sizeof(std::ostrstream *) * sets_max);
set_nums = (int *)
realloc(set_nums, sizeof(int) * sets_max);
}
@@ -528,7 +529,7 @@ case 1:
}
if (cur_set >= 0)
*sets[cur_set] << '\0';
- sets[cur_set = sets_cnt++] = new ostrstream;
+ sets[cur_set = sets_cnt++] = new std::ostrstream;
*sets[cur_set] << (char*)yytext;
@@ -556,7 +557,7 @@ case 3:
case 4:
{
if (cur_set < 0) { // maybe not a message id
- cout << (char*)yytext;
+ std::cout << (char*)yytext;
}
else { // must be a message id
*sets[cur_set] << (char*)yytext;
@@ -581,7 +582,7 @@ case 7:
case 8:
{
if (cur_set < 0)
- cout << *(char*)yytext;
+ std::cout << *(char*)yytext;
else
*sets[cur_set] << *(char*)yytext;
}
@@ -1151,7 +1152,7 @@ main()
for (i = 0; i < sets_cnt; i++) {
const char* record = sets[sorted[i]]->str();
- cout << record << '\n' << flush;
+ std::cout << record << '\n' << std::flush;
}
free(sorted);
diff --git a/cde/programs/dtinfo/tools/misc/treeres
b/cde/programs/dtinfo/tools/misc/treeres
index 6537743..d077302 100755
--- a/cde/programs/dtinfo/tools/misc/treeres
+++ b/cde/programs/dtinfo/tools/misc/treeres
@@ -1,5 +1,5 @@
# feed this into perl
-eval '(exit $?0)' && eval 'exec /usr/local/bin/perl $0 ${1+"$@"}' & eval 'exec
/usr/local/bin/perl $0 $argv'
+eval '(exit $?0)' && eval 'exec /usr/bin/perl $0 ${1+"$@"}' & eval 'exec
/usr/bin/perl $0 $argv'
if 0;
# treeres - resource file preprocessor
--
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