rename pdp10_stdint.hrl to stdint.hrl, drop PDP10_ prefixes from macros

This commit is contained in:
Mikael Pettersson
2025-08-11 14:48:45 +02:00
parent a52866cd52
commit 7348b7776b
9 changed files with 84 additions and 93 deletions

View File

@@ -29,7 +29,7 @@
-ifndef(LIBELF_HRL).
-define(LIBELF_HRL, 1).
-include("pdp10_stdint.hrl").
-include("stdint.hrl").
-type uint8_t() :: 0..((1 bsl 8) - 1).
-type uint16_t() :: 0..((1 bsl 16) - 1).

View File

@@ -1,7 +1,7 @@
%%% -*- erlang-indent-level: 2 -*-
%%%
%%% pdp10_ar.hrl -- AR definitions for pdp10-elf
%%% Copyright (C) 2013-2023 Mikael Pettersson
%%% Copyright (C) 2013-2025 Mikael Pettersson
%%%
%%% This file is part of pdp10-tools.
%%%
@@ -28,7 +28,7 @@
-ifndef(PDP10_AR_HRL).
-define(PDP10_AR_HRL, 1).
-include_lib("lib/include/pdp10_stdint.hrl"). % uint9_t()
-include_lib("lib/include/stdint.hrl"). % uint9_t()
-define(PDP10_ARMAG, [$!, $<, $a, $r, $c, $h, $>, $\n]). % String that begins an archive file.
-define(PDP10_SARMAG, 8). % Size of that string.

View File

@@ -1,58 +0,0 @@
%%% -*- erlang-indent-level: 2 -*-
%%%
%%% pdp10_stdint.hrl -- stdint.h for PDP10
%%% Copyright (C) 2013-2023 Mikael Pettersson
%%%
%%% This file is part of pdp10-tools.
%%%
%%% pdp10-tools is free software: you can redistribute it and/or modify
%%% it under the terms of the GNU General Public License as published by
%%% the Free Software Foundation, either version 3 of the License, or
%%% (at your option) any later version.
%%%
%%% pdp10-tools is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%%% GNU General Public License for more details.
%%%
%%% You should have received a copy of the GNU General Public License
%%% along with pdp10-tools. If not, see <http://www.gnu.org/licenses/>.
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% Provide stdint.h-like type names and macros for 9, 18, and 36-bit integers.
%%%
%%% Standard {u,}int<N>_t types must not contain any extraneous bits, but that
%%% cannot be guaranteed for these 9, 18, and 36-bit types embedded in Erlang
%%% integers of unbounded precision. For arithmetic on these types, use the
%%% operations provided by pdp10_arith.
%%%
%%% Do not use these 18 or 36-bit types for file-level binary data structures,
%%% instead use the pdp10_extint and pdp10_stdio facilities to explicitly
%%% convert between file-level and host-level binary data structures.
-ifndef(PDP10_STDINT_HRL).
-define(PDP10_STDINT_HRL, 1).
-define(PDP10_UINT9_MAX, ((1 bsl 9) - 1)).
-type uint9_t() :: 0..?PDP10_UINT9_MAX.
-define(PDP10_INT9_MAX, ((1 bsl (9 - 1)) - 1)).
-define(PDP10_INT9_MIN, (-?PDP10_INT9_MAX - 1)).
-type int9_t() :: ?PDP10_INT9_MIN..?PDP10_INT9_MAX.
-define(PDP10_UINT18_MAX, ((1 bsl 18) - 1)).
-type uint18_t() :: 0..?PDP10_UINT18_MAX.
-define(PDP10_INT18_MAX, ((1 bsl (18 - 1)) - 1)).
-define(PDP10_INT18_MIN, (-?PDP10_INT18_MAX - 1)).
-type int18_t() :: ?PDP10_INT18_MIN..?PDP10_INT18_MAX.
-define(PDP10_UINT36_MAX, ((1 bsl 36) - 1)).
-type uint36_t() :: 0..?PDP10_UINT36_MAX.
-define(PDP10_INT36_MAX, ((1 bsl (36 - 1)) - 1)).
-define(PDP10_INT36_MIN, (-?PDP10_INT36_MAX - 1)).
-type int36_t() :: ?PDP10_INT36_MIN..?PDP10_INT36_MAX.
-endif. % PDP10_STDINT_HRL

View File

@@ -0,0 +1,49 @@
%%% -*- erlang-indent-level: 2 -*-
%%%
%%% stdint.hrl -- stdint.h for Erlang
%%% Copyright (C) 2013-2025 Mikael Pettersson
%%%
%%% This file is part of pdp10-tools.
%%%
%%% pdp10-tools is free software: you can redistribute it and/or modify
%%% it under the terms of the GNU General Public License as published by
%%% the Free Software Foundation, either version 3 of the License, or
%%% (at your option) any later version.
%%%
%%% pdp10-tools is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%%% GNU General Public License for more details.
%%%
%%% You should have received a copy of the GNU General Public License
%%% along with pdp10-tools. If not, see <http://www.gnu.org/licenses/>.
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% Provide stdint.h-like type names and macros for 9, 18, and 36-bit integers.
-ifndef(STDINT_HRL).
-define(STDINT_HRL, 1).
-define(UINT9_MAX, ((1 bsl 9) - 1)).
-type uint9_t() :: 0..?UINT9_MAX.
-define(INT9_MAX, ((1 bsl (9 - 1)) - 1)).
-define(INT9_MIN, (-?INT9_MAX - 1)).
-type int9_t() :: ?INT9_MIN..?INT9_MAX.
-define(UINT18_MAX, ((1 bsl 18) - 1)).
-type uint18_t() :: 0..?UINT18_MAX.
-define(INT18_MAX, ((1 bsl (18 - 1)) - 1)).
-define(INT18_MIN, (-?INT18_MAX - 1)).
-type int18_t() :: ?INT18_MIN..?INT18_MAX.
-define(UINT36_MAX, ((1 bsl 36) - 1)).
-type uint36_t() :: 0..?UINT36_MAX.
-define(INT36_MAX, ((1 bsl (36 - 1)) - 1)).
-define(INT36_MIN, (-?INT36_MAX - 1)).
-type int36_t() :: ?INT36_MIN..?INT36_MAX.
-endif. % STDINT_HRL