Skip to content

Commit 89952ae

Browse files
author
Nicholas Reed
committed
Add public domain getopt implementation. SCL git c3f9ff5, dc302ea, and 2d26da7.
1 parent d4fc6e1 commit 89952ae

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

include/express/basic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ typedef int ( *intFuncptr )();
135135
# define PROTO(x) x
136136
# else
137137

138-
# ifdef __CLCC__
138+
# if defined(__CLCC__) || defined(__MSVC__) || defined(__BORLAND__)
139139
# define PROTO(x) x
140140
#else
141141
# define PROTO(x) ()

include/express/dict.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#ifndef DICTIONARY_H
22
#define DICTIONARY_H
33

4-
/* $Id: dict.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
5-
6-
/************************************************************************
4+
/** **********************************************************************
75
** Module: Dictionary
86
** Description: This module implements the dictionary abstraction. A
97
** dictionary is a repository for a number of objects, all of which
@@ -52,7 +50,6 @@
5250

5351
#include "hash.h"
5452
#include "error.h"
55-
#include "dict.h"
5653

5754
/************/
5855
/* typedefs */

src/exppp/exppp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ SCOPEalgs_out( Scope s, int level ) {
571571
}
572572

573573
static int
574-
min( int a, int b, int c ) {
574+
minimum( int a, int b, int c ) {
575575
if( a < b ) {
576576
return ( ( a < c ) ? a : c );
577577
} else {
@@ -606,7 +606,7 @@ static void copy_file_chunk( char * filename, int start, int end, int level ) {
606606
/* copy the rest */
607607
for( i = end - start; i--; ) {
608608
fgets( buff, 255, infile );
609-
fix = min( undent, strlen( buff ), strspn( buff, " " ) );
609+
fix = minimum( undent, strlen( buff ), strspn( buff, " " ) );
610610
raw( "%*s%s", indent + fix, "", buff + fix );
611611
}
612612

src/express/fedex.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,16 @@ char * FEDEXversion( void ) {
7575
return( "V2.11.4-beta CADDETC preval June 8, 1995" );
7676
}
7777

78-
#include <getopt.h>
78+
#include <scl_cf.h>
79+
#include <scl_export.h>
7980
#include <stdlib.h>
8081
#include <stdio.h>
81-
#include <unistd.h>
82+
#ifdef HAVE_UNISTD_H
83+
# include <unistd.h>
84+
#endif
85+
#ifndef HAVE_GETOPT
86+
# include "xgetopt.h"
87+
#endif
8288
#include "express/error.h"
8389
#include "express/express.h"
8490
#include "express/resolve.h"

src/fedex_plus/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,13 @@ include_directories(
2929
${SCL_SOURCE_DIR}/include/exppp
3030
${SCL_SOURCE_DIR}/include/express
3131
)
32+
IF(MSVC OR BORLAND)
33+
set(fedex_plus_EXTRA_SOURCES
34+
xgetopt.cc
35+
)
36+
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
37+
add_definitions( -DSCL_EXPPP_DLL_IMPORTS )
38+
add_definitions( -DSCL_BASE_DLL_IMPORTS )
39+
ENDIF()
3240

33-
SCL_ADDEXEC(fedex_plus "${fedex_plus_SOURCES}" "libexppp;express")
41+
SCL_ADDEXEC(fedex_plus "${fedex_plus_SOURCES}${fedex_plus_EXTRA_SOURCES}" "libexppp;express")

0 commit comments

Comments
 (0)