-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jnr:master' into doc-improvement
- Loading branch information
Showing
41 changed files
with
6,338 additions
and
1,300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,28 +10,49 @@ on: | |
branches: [ master ] | ||
|
||
jobs: | ||
jdk8: | ||
|
||
mvn-test-ubuntu-x86: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
java-version: ['8', '11'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 8 | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Set up JDK ${{ matrix.java-version }} | ||
uses: actions/[email protected] | ||
with: | ||
java-version: 8 | ||
java-version: ${{ matrix.java-version }} | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
|
||
jdk11: | ||
mvn-test-macos-aarch64: | ||
|
||
runs-on: ubuntu-latest | ||
runs-on: [self-hosted, macos, aarch64] | ||
|
||
name: mvn test on Apple M1 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1.4.3 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 11 | ||
architecture: arm | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#include <sys/types.h> | ||
#include <sys/param.h> | ||
|
||
#ifndef __mips__ | ||
# include <stdint.h> | ||
#endif | ||
|
||
#if defined(__mips64) || defined(__PASE__) | ||
# include <stdint.h> | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdbool.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
// Let's define the stdint.h typedefs ourselves if they can't be found | ||
#if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(_SYS__STDINT_H_) && !defined(_H_STDINT) | ||
typedef signed char int8_t; | ||
typedef signed short int16_t; | ||
typedef signed int int32_t; | ||
typedef signed long long int64_t; | ||
typedef unsigned char uint8_t; | ||
typedef unsigned short uint16_t; | ||
typedef unsigned int uint32_t; | ||
typedef unsigned long long uint64_t; | ||
#endif | ||
|
||
typedef long double ldouble; | ||
typedef unsigned long ulong; | ||
typedef void* pointer; | ||
typedef void* ptr; | ||
typedef enum Enum_t {e0, e1, e2, e3} Enum; | ||
typedef bool boolean; | ||
|
||
#define RET(T) T ptr_num_ret_##T(void *p, int offset) { \ | ||
T tmp; memcpy(&tmp, (ptr) (p + offset), sizeof(tmp)); return tmp; \ | ||
} | ||
#define SET(T) void ptr_num_set_##T(void *p, int offset, T value) { \ | ||
memcpy((ptr) (p + offset), &value, sizeof(value)); \ | ||
} | ||
|
||
#define TEST(T) SET(T) RET(T) | ||
|
||
TEST(int8_t); | ||
TEST(int16_t); | ||
TEST(int32_t); | ||
TEST(long); | ||
TEST(int64_t); | ||
|
||
TEST(uint8_t); | ||
TEST(uint16_t); | ||
TEST(uint32_t); | ||
TEST(ulong); | ||
TEST(uint64_t); | ||
|
||
TEST(float); | ||
TEST(double); | ||
TEST(ldouble); | ||
|
||
TEST(boolean); | ||
TEST(pointer); | ||
TEST(Enum); | ||
|
||
void *ptr_num_arr_get(void **array, int index) { | ||
return array[index]; | ||
} | ||
|
||
void ptr_num_arr_set(void **array, int index, void *value) { | ||
array[index] = value; | ||
} |
Oops, something went wrong.