Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1e5224f
Add files for Windows
kio-watanabe Apr 19, 2024
06a2ddc
Add a sln file
kio-watanabe Apr 19, 2024
38c1ebe
Add a sln file
kio-watanabe May 1, 2024
10a9015
Create msbuild.yml
kio-watanabe May 7, 2024
4ab664b
Fix cobj.c
kio-watanabe May 7, 2024
af23aae
Fix codegen.c
kio-watanabe May 7, 2024
f680989
Fix yml for msbuild
kio-watanabe May 7, 2024
af7db51
Fix some yml files
kio-watanabe May 7, 2024
52ec610
Add files for windows
kio-watanabe May 7, 2024
10cee3d
Add a file for windows
kio-watanabe May 7, 2024
d1ee3df
Fix yml file for windows
kio-watanabe May 7, 2024
d183741
Fix getopt.c
kio-watanabe May 7, 2024
aff0896
Move some files
kio-watanabe May 7, 2024
cee7a0f
Fix some files
kio-watanabe May 7, 2024
b5a2133
Fix c macro description
kio-watanabe May 7, 2024
ef2c9a3
Fix c macro description
kio-watanabe May 7, 2024
760cb12
Fix c macro description
kio-watanabe May 7, 2024
79338ce
Fix c macro description
kio-watanabe May 7, 2024
e6e7e41
Fix c macro description
kio-watanabe May 7, 2024
9d16470
Fix c macro description
kio-watanabe May 7, 2024
0321b66
Fix c macro description
kio-watanabe May 7, 2024
251247d
Fix c macro description
kio-watanabe May 7, 2024
571cf85
Fix yml file for windows
kio-watanabe May 7, 2024
9053617
Fix yml file for windows
kio-watanabe May 7, 2024
872eb74
Fix yml file for windows
kio-watanabe May 7, 2024
dc07287
Update version of cobj
kio-watanabe May 7, 2024
6ca9255
Execute ./format
kio-watanabe May 7, 2024
f07b0af
Update version of cobj
kio-watanabe May 7, 2024
fc75e19
Fix c macro description
kio-watanabe May 9, 2024
f150b4c
Merge branch 'for_windows' of https://github.com/kio-watanabe/opensou…
kio-watanabe May 9, 2024
ad3c42a
Fix yml file for windows
kio-watanabe May 9, 2024
a531eb7
Fix yml file for windows
kio-watanabe May 9, 2024
039efef
Execute google format
kio-watanabe May 10, 2024
e06d2c5
Fix c macro
kio-watanabe May 10, 2024
1dd396b
Upadate version of this tool
kio-watanabe May 10, 2024
2dc4f40
Delete unnecessary codes
kio-watanabe May 10, 2024
779ae2e
Delete unnecessary codes
kio-watanabe May 13, 2024
71d3afd
Merge branch 'for_windows2' of https://github.com/kio-watanabe/openso…
kio-watanabe May 13, 2024
bd29086
Fix static analysis error
kio-watanabe May 13, 2024
e22b021
Fix c macro
kio-watanabe May 13, 2024
5e98080
Change name of a sln file.
kio-watanabe May 16, 2024
95e99df
Change name of a sln file
kio-watanabe May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: MSBuild

on:
workflow_call:

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2

- name: Restore NuGet packages
run: nuget restore ./win/

- name: Build
run: msbuild /p:AdditionalIncludePaths=./:./cobj/:./win:./lib win/opensourcecobol4j.sln

- name: exec cobj
run: |
cd win/x64/Debug
./cobj.exe --version
3 changes: 3 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ jobs:
javadoc:
uses: ./.github/workflows/javadoc.yml

MSbuild:
uses: ./.github/workflows/msbuild.yml

static-analysis:
uses: ./.github/workflows/static-analysis.yml
3 changes: 3 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@ jobs:
javadoc:
uses: ./.github/workflows/javadoc.yml

MSBuild:
uses: ./.github/workflows/msbuild.yml

static-analysis:
uses: ./.github/workflows/static-analysis.yml
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-04-30 OSS Consortium <ws-opensource-cobol-contact@osscons.jp>

* opensource COBOL 4J v1.0.22 released.

2024-03-29 OSS Consortium <ws-opensource-cobol-contact@osscons.jp>

* opensource COBOL 4J v1.0.21 released.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ dnf install -y java-21-amazon-corretto-devel gcc make bison flex automake autoco

### Install opensource COBOL 4J
```
curl -L -o opensourcecobol4j-v1.0.21.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.0.21.tar.gz
tar zxvf opensourcecobol4j-v1.0.21.tar.gz
cd opensourcecobol4j-1.0.21
curl -L -o opensourcecobol4j-v1.0.22.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.0.22.tar.gz
tar zxvf opensourcecobol4j-v1.0.22.tar.gz
cd opensourcecobol4j-1.0.22
./configure --prefix=/usr/
make
sudo make install
Expand All @@ -72,7 +72,7 @@ In order to check installations of older versions,
The docker container for opensource COBOL 4J is available.

```bash
docker pull opensourcecobol/opensourcecobol4j:1.0.21
docker pull opensourcecobol/opensourcecobol4j:1.0.22
```

Execute the following commands in order to run the "Hello World" COBOL program.
Expand Down
12 changes: 6 additions & 6 deletions README_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ opensource COBOL 4J は下記の環境でテストされています.

## インストール

opensource COBOL 4J v1.0.21はUbuntuとAlmaLinuxで動作を確認しています.
opensource COBOL 4J v1.0.22はUbuntuとAlmaLinuxで動作を確認しています.

## 手動インストール

Expand Down Expand Up @@ -57,9 +57,9 @@ dnf install -y java-21-amazon-corretto-devel gcc make bison flex automake autoco
下記のコマンドを実行する

```
curl -L -o opensourcecobol4j-v1.0.21.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.0.21.tar.gz
tar zxvf opensourcecobol4j-v1.0.21.tar.gz
cd opensourcecobol4j-1.0.21
curl -L -o opensourcecobol4j-v1.0.22.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.0.22.tar.gz
tar zxvf opensourcecobol4j-v1.0.22.tar.gz
cd opensourcecobol4j-1.0.22
./configure --prefix=/usr/
make
sudo make install
Expand All @@ -73,10 +73,10 @@ sudo make install

## Dockerによるインストール

opensource COBOL 4J v1.0.21をインストールしたDockerイメージを利用できます.
opensource COBOL 4J v1.0.22をインストールしたDockerイメージを利用できます.

```bash
docker pull opensourcecobol/opensourcecobol4j:1.0.21
docker pull opensourcecobol/opensourcecobol4j:1.0.22
```

コンテナ内で下記のコマンドを実行すると、Hello Worldプログラムをコンパイル&実行できる。
Expand Down
4 changes: 2 additions & 2 deletions cobj/cobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,8 +1363,8 @@ static char *cobc_temp_name(const char *ext) {
#ifdef _WIN32
char temp[MAX_PATH];

GetTempPath(MAX_PATH, temp);
GetTempFileName(temp, "cob", 0, buff);
GetTempPath2A(MAX_PATH, temp);
GetTempFileNameA(temp, "cob", 0, buff);
DeleteFile(buff);
strcpy(buff + strlen(buff) - 4, ext); /* replace ".tmp" by EXT */
#else
Expand Down
11 changes: 10 additions & 1 deletion cobj/cobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@

#include <stdio.h>

#include "lib/gettext.h"
#ifdef _WIN32
#include <libcobj.h>
#else
#include "libcobj.h"
#endif

#ifdef _WIN32
#include <gettext.h>
#else
#include "lib/gettext.h"
#endif

#if !defined(__i386__) && !defined(__x86_64__) && !defined(__powerpc__) && \
!defined(__powerpc64__) && !defined(__ppc__) && !defined(__amd64__)
Expand Down
21 changes: 13 additions & 8 deletions cobj/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
#define INITIALIZE_ONE 1
#define INITIALIZE_DEFAULT 2
#define INITIALIZE_COMPOUND 3
#define EXECUTION_NORMAL 0
#define EXECUTION_LAST 1
#define EXECUTION_ERROR_HANDLER 2
#define BUF_SIZE 1024
#define MAX_LITERAL_SIZE 64

#ifndef __GNUC__
static int inside_check = 0;
Expand Down Expand Up @@ -189,10 +194,6 @@ static void joutput_label_variable_name(char *s, int key,
struct cb_label *section);
static void joutput_label_variable_by_value(int value);

const int EXECUTION_NORMAL = 0;
const int EXECUTION_LAST = 1;
const int EXECUTION_ERROR_HANDLER = 2;

static char *get_java_identifier_field(struct cb_field *f) {
char *buf = malloc(COB_SMALL_BUFF);
if (cb_flag_serial_variable) {
Expand Down Expand Up @@ -627,13 +628,15 @@ static void joutput_edit_code_command(const char *target) {
return;
}

const int BUF_SIZE = 1024;

char command[BUF_SIZE];
char buf[BUF_SIZE];
sprintf(command, "%s --target=%s", edit_code_command, target);

#ifdef _WIN32
FILE *fp = _popen(command, "r");
#else
FILE *fp = popen(command, "r");
#endif
if (fp == NULL) {
return;
}
Expand All @@ -642,8 +645,11 @@ static void joutput_edit_code_command(const char *target) {
while (fgets(buf, BUF_SIZE, fp) != NULL) {
joutput("%s", buf);
}

#ifdef _WIN32
_pclose(fp);
#else
pclose(fp);
#endif
}

/*
Expand Down Expand Up @@ -1188,7 +1194,6 @@ static struct literal_list *lookup_literal(cb_tree x) {
}

static void joutput_const_identifier(struct literal_list *l) {
const int MAX_LITERAL_SIZE = 64;
char s[MAX_LITERAL_SIZE + 1];
memset(s, 0, MAX_LITERAL_SIZE + 1);
int i = 0;
Expand Down
4 changes: 4 additions & 0 deletions cobj/flag-help.def
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
* This file describes the options shown when executing cobj --help command
*/

#ifdef _WIN32
#include <gettext.h>
#else
#include "lib/gettext.h"
#endif

CB_FLAG (cb_flag_trace, "trace",
N_("Generate trace code (Executed SECTION/PARAGRAPH)"))
Expand Down
5 changes: 4 additions & 1 deletion cobj/flag.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* Boston, MA 02110-1301 USA
*/


#ifdef _WIN32
#include <gettext.h>
#else
#include "lib/gettext.h"
#endif

/* CB_FLAG (var, name, doc) */

Expand Down
4 changes: 4 additions & 0 deletions cobj/warning-help.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
* Boston, MA 02110-1301 USA
*/

#ifdef _WIN32
#include <gettext.h>
#else
#include "lib/gettext.h"
#endif

/* CB_WARNDEF (var, name, wall, doc) */

Expand Down
4 changes: 4 additions & 0 deletions cobj/warning.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
* Boston, MA 02110-1301 USA
*/

#ifdef _WIN32
#include <gettext.h>
#else
#include "lib/gettext.h"
#endif

/* CB_WARNDEF (var, name, wall, doc) */

Expand Down
26 changes: 13 additions & 13 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.21.
# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.22.
#
# Report bugs to <ws-opensource-cobol-contact@osscons.jp>.
#
Expand Down Expand Up @@ -620,9 +620,9 @@ MAKEFLAGS=

# Identity of this package.
PACKAGE_NAME='opensource COBOL 4J'
PACKAGE_TARNAME='opensource-cobol-4j-1.0.21'
PACKAGE_VERSION='1.0.21'
PACKAGE_STRING='opensource COBOL 4J 1.0.21'
PACKAGE_TARNAME='opensource-cobol-4j-1.0.22'
PACKAGE_VERSION='1.0.22'
PACKAGE_STRING='opensource COBOL 4J 1.0.22'
PACKAGE_BUGREPORT='ws-opensource-cobol-contact@osscons.jp'
PACKAGE_URL=''

Expand Down Expand Up @@ -1411,7 +1411,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures opensource COBOL 4J 1.0.21 to adapt to many kinds of systems.
\`configure' configures opensource COBOL 4J 1.0.22 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1461,7 +1461,7 @@ Fine tuning of the installation directories:
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root
[DATAROOTDIR/doc/opensource-cobol-4j-1.0.21]
[DATAROOTDIR/doc/opensource-cobol-4j-1.0.22]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
Expand All @@ -1483,7 +1483,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.21:";;
short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.22:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1611,7 +1611,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
opensource COBOL 4J configure 1.0.21
opensource COBOL 4J configure 1.0.22
generated by GNU Autoconf 2.71

Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2099,7 +2099,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by opensource COBOL 4J $as_me 1.0.21, which was
It was created by opensource COBOL 4J $as_me 1.0.22, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3397,8 +3397,8 @@ fi


# Define the identity of the package.
PACKAGE='opensource-cobol-4j-1.0.21'
VERSION='1.0.21'
PACKAGE='opensource-cobol-4j-1.0.22'
VERSION='1.0.22'


printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
Expand Down Expand Up @@ -24216,7 +24216,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by opensource COBOL 4J $as_me 1.0.21, which was
This file was extended by opensource COBOL 4J $as_me 1.0.22, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -24284,7 +24284,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
opensource COBOL 4J config.status 1.0.21
opensource COBOL 4J config.status 1.0.22
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

AC_PREREQ(2.59)

AC_INIT([opensource COBOL 4J],[1.0.21],[ws-opensource-cobol-contact@osscons.jp],[opensource-cobol-4j-1.0.21])
AC_INIT([opensource COBOL 4J],[1.0.22],[ws-opensource-cobol-contact@osscons.jp],[opensource-cobol-4j-1.0.22])
AC_CONFIG_SRCDIR([libcobj.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_TESTDIR([tests])
Expand Down
2 changes: 0 additions & 2 deletions lib/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ static char *posixly_correct;

# if HAVE_STRING_H
# include <string.h>
# else
# include <strings.h>
# endif

/* Avoid depending on library functions or files
Expand Down
2 changes: 1 addition & 1 deletion libcobj/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ publishing {
register<MavenPublication>("gpr") {
groupId = "jp.osscons.opensourcecobol"
artifactId = "libcobj"
version = "1.0.21"
version = "1.0.22"
from(components["java"])
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ public class Const {
// TODO 標準パスの設定
public static final String COB_LIBRARY_PATH = "";

public static final String version = "1.0.21";
public static final String version = "1.0.22";
}
Loading