mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-18 15:26:31 +00:00
Update the samples to use MR_ types and MR_ macros for
Estimated hours taken: 0.5 samples/c_interface/c_calls_mercury/c_main.c: samples/c_interface/cplusplus_calls_mercury/cpp_main.cc: samples/c_interface/simpler_c_calls_mercury/c_main.c: samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc: Update the samples to use MR_ types and MR_ macros for creating lists.
This commit is contained in:
@@ -5,13 +5,13 @@ extern "C" {
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef Word MercuryList;
|
||||
typedef MR_Word MercuryList;
|
||||
|
||||
static void print_list(MercuryList);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char dummy;
|
||||
Integer value;
|
||||
MR_Integer value;
|
||||
MercuryList list;
|
||||
int exit_status;
|
||||
|
||||
@@ -94,15 +94,15 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
static void print_list(MercuryList list) {
|
||||
if (list_is_empty(list)) {
|
||||
if (MR_list_is_empty(list)) {
|
||||
printf("[]");
|
||||
} else {
|
||||
printf("[");
|
||||
printf("%ld", (long) list_head(list));
|
||||
list = list_tail(list);
|
||||
list = MR_list_tail(list);
|
||||
while (!list_is_empty(list)) {
|
||||
printf(", %ld", (long) list_head(list));
|
||||
list = list_tail(list);
|
||||
printf(", %ld", (long) MR_list_head(list));
|
||||
list = MR_list_tail(list);
|
||||
}
|
||||
printf("]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user