You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
helpviewer_keywords: ["/internalPartition", "Translate include directives into import directives"]
9
9
---
10
10
# `/internalPartition`
11
11
12
-
Use this switch to treat the input file on the command line as an [internal partition unit](http://eel.is/c%2B%2Bdraft/module#unit-4.3).
12
+
Use the **`/internalPartition`** compiler option to treat the input file as an *internal partition unit*, which is a [module partition implementation unit](../../cpp/modules-cpp.md#implementing-modules) that doesn't contribute to the external interface of the module.
13
13
14
14
## Syntax
15
15
16
16
> **`/internalPartition`***`filename`*
17
17
18
18
## Remarks
19
19
20
-
The following example demonstrates using the `/internalPartition` switch:
21
-
22
-
`m-internals.cpp`:
20
+
The following example demonstrates how to use the `/internalPartition` option:
23
21
24
22
```cpp
23
+
// m-internals.cpp
25
24
module m:internals;
26
25
27
26
voidinternalFunc() {} // cannot have `export` since this is an internal partition
28
27
```
29
28
30
-
`m.ixx`:
31
-
32
29
```cpp
30
+
// m.ixx
33
31
exportmodule m;
34
32
import :internals; // Cannot export this partition.
Pointer to the structure containing error information.
27
26
28
27
## Return Value
29
28
30
-
**_matherr** returns 0 to indicate an error, or a nonzero value to indicate success. If **_matherr** returns 0, an error message can be displayed and **errno** is set to an appropriate error value. If **_matherr** returns a nonzero value, no error message is displayed and **errno** remains unchanged.
29
+
**`_matherr`** returns 0 to indicate an error, or a nonzero value to indicate success:
30
+
- If **`_matherr`** returns 0, an error message can be displayed and **`errno`** is set to an appropriate error value.
31
+
- If **`_matherr`** returns a nonzero value, no error message is displayed and **`errno`** remains unchanged.
31
32
32
-
For more information about return codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
33
+
For more information about return codes, see [`_doserrno`, `errno`, `_sys_errlist`, and `_sys_nerr`](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
33
34
34
35
## Remarks
35
36
36
-
The **_matherr** function processes errors generated by the floating-point functions of the math library. These functions call **_matherr** when an error is detected.
37
+
The **`_matherr`** function processes errors generated by the floating-point functions of the math library. These functions call **`_matherr`** when an error is detected. This interaction isn't impacted by the [floating-point mode of the compiler](../../build/reference/fp-specify-floating-point-behavior.md) or the [floating point control word](../../c-runtime-library/reference/control87-controlfp-control87-2.md). Since **`_matherr`** is a library function, math [intrinsic functions](../../intrinsics/compiler-intrinsics.md) won't call it.
37
38
38
-
For special error handling, you can provide a different definition of **_matherr**. If you use the dynamically linked version of the C run-time library (CRT), you can replace the default **_matherr** routine in a client executable with a user-defined version. However, you cannot replace the default **_matherr** routine in a DLL client of the CRT DLL.
39
+
For special error handling, you can provide a different definition of **`_matherr`**. If you use the dynamically linked version of the C run-time library (CRT), you can replace the default **`_matherr`** routine in a client executable with a user-defined version. However, you can't replace the default **`_matherr`** routine in a DLL client of the CRT DLL.
39
40
40
-
When an error occurs in a math routine, **_matherr** is called with a pointer to an **_exception** type structure (defined in \<math.h>) as an argument. The **_exception** structure contains the following elements.
41
+
When an error occurs in a math routine, **`_matherr`** is called with a pointer to an **`_exception`** type structure (defined in `<math.h>`) as an argument. The **`_exception`** structure contains the following elements.
41
42
42
43
```C
43
44
struct _exception
@@ -50,36 +51,36 @@ struct _exception
50
51
};
51
52
```
52
53
53
-
The **type** member specifies the type of math error. It is one of the following values, defined in \<math.h>:
54
+
The **`type`** member specifies the type of math error. It's one of the following values, defined in `<math.h>`:
54
55
55
56
|Macro|Meaning|
56
57
|-|-|
57
-
|**_DOMAIN**| Argument domain error |
58
-
|**_SING**| Argument singularity |
59
-
|**_OVERFLOW**| Overflow range error |
60
-
|**_PLOSS**| Partial loss of significance |
61
-
|**_TLOSS**| Total loss of significance |
62
-
|**_UNDERFLOW**| The result is too small to be represented. (This condition is not currently supported.) |
58
+
|**`_DOMAIN`**| Argument domain error |
59
+
|**`_SING`**| Argument singularity |
60
+
|**`_OVERFLOW`**| Overflow range error |
61
+
|**`_PLOSS`**| Partial loss of significance |
62
+
|**`_TLOSS`**| Total loss of significance |
63
+
|**`_UNDERFLOW`**| The result is too small to be represented. (This condition isn't currently supported.) |
63
64
64
-
The structure member **name** is a pointer to a null-terminated string containing the name of the function that caused the error. The structure members **arg1** and **arg2** specify the values that caused the error. If only one argument is given, it is stored in **arg1**.
65
+
The structure member **`name`** is a pointer to a null-terminated string containing the name of the function that caused the error. The structure members **`arg1`** and **`arg2`** specify the values that caused the error. If only one argument is given, it's stored in **`arg1`**.
65
66
66
-
The default return value for the given error is **retval**. If you change the return value, it must specify whether an error actually occurred.
67
+
The default return value for the given error is **`retval`**. If you change the return value, it must specify whether an error actually occurred.
67
68
68
69
## Requirements
69
70
70
71
|Routine|Required header|
71
72
|-------------|---------------------|
72
-
|**_matherr**|\<math.h>|
73
+
|**`_matherr`**|`<math.h>`|
73
74
74
75
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
75
76
76
77
## Example
77
78
78
79
```C
79
-
// crt_matherr.c
80
-
/* illustrates writing an error routine for math
81
-
* functions. The error function must be:
82
-
* _matherr
80
+
/* crt_matherr.c
81
+
* Illustrates writing an error routine for math
82
+
* functions.
83
+
* The error handling function must be named _matherr
83
84
*/
84
85
85
86
#include<math.h>
@@ -102,27 +103,27 @@ int main()
102
103
* returns the natural or base-10 logarithm of the absolute value
103
104
* of the argument and suppresses the usual error message.
104
105
*/
105
-
int_matherr(struct _exception *except)
106
+
int_matherr(struct _exception *except)
106
107
{
107
108
/* Handle _DOMAIN errors for log or log10. */
108
-
if( except->type == _DOMAIN)
109
+
if (except->type == _DOMAIN)
109
110
{
110
-
if( strcmp(except->name, "log") == 0)
111
+
if (strcmp(except->name, "log") == 0)
111
112
{
112
-
except->retval = log(-(except->arg1));
113
-
printf("Special: using absolute value: %s: _DOMAIN "
114
-
"error\n", except->name);
113
+
except->retval = log(-(except->arg1));
114
+
printf("Special: using absolute value: %s: _DOMAIN "
115
+
"error\n", except->name);
115
116
return 1;
116
117
}
117
-
else if( strcmp(except->name, "log10") == 0)
118
+
else if (strcmp(except->name, "log10") == 0)
118
119
{
119
-
except->retval = log10(-(except->arg1));
120
-
printf("Special: using absolute value: %s: _DOMAIN "
121
-
"error\n", except->name);
120
+
except->retval = log10(-(except->arg1));
121
+
printf("Special: using absolute value: %s: _DOMAIN "
0 commit comments